Lines Matching refs:D

57     void VisitTranslationUnitDecl(TranslationUnitDecl *D);
58 void VisitTypedefDecl(TypedefDecl *D);
59 void VisitTypeAliasDecl(TypeAliasDecl *D);
60 void VisitEnumDecl(EnumDecl *D);
61 void VisitRecordDecl(RecordDecl *D);
62 void VisitEnumConstantDecl(EnumConstantDecl *D);
63 void VisitEmptyDecl(EmptyDecl *D);
64 void VisitFunctionDecl(FunctionDecl *D);
65 void VisitFriendDecl(FriendDecl *D);
66 void VisitFieldDecl(FieldDecl *D);
67 void VisitVarDecl(VarDecl *D);
68 void VisitLabelDecl(LabelDecl *D);
69 void VisitParmVarDecl(ParmVarDecl *D);
70 void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
71 void VisitImportDecl(ImportDecl *D);
72 void VisitStaticAssertDecl(StaticAssertDecl *D);
73 void VisitNamespaceDecl(NamespaceDecl *D);
74 void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
75 void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
76 void VisitCXXRecordDecl(CXXRecordDecl *D);
77 void VisitLinkageSpecDecl(LinkageSpecDecl *D);
78 void VisitTemplateDecl(const TemplateDecl *D);
79 void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
80 void VisitClassTemplateDecl(ClassTemplateDecl *D);
81 void VisitObjCMethodDecl(ObjCMethodDecl *D);
82 void VisitObjCImplementationDecl(ObjCImplementationDecl *D);
83 void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
84 void VisitObjCProtocolDecl(ObjCProtocolDecl *D);
85 void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
86 void VisitObjCCategoryDecl(ObjCCategoryDecl *D);
87 void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D);
88 void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
89 void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
90 void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
91 void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);
92 void VisitUsingDecl(UsingDecl *D);
93 void VisitUsingShadowDecl(UsingShadowDecl *D);
94 void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D);
98 void prettyPrintAttributes(Decl *D);
99 void prettyPrintPragmas(Decl *D);
139 static QualType getDeclType(Decl* D) { in getDeclType() argument
140 if (TypedefNameDecl* TDD = dyn_cast<TypedefNameDecl>(D)) in getDeclType()
142 if (ValueDecl* VD = dyn_cast<ValueDecl>(D)) in getDeclType()
198 void DeclPrinter::prettyPrintAttributes(Decl *D) { in prettyPrintAttributes() argument
202 if (D->hasAttrs()) { in prettyPrintAttributes()
203 AttrVec &Attrs = D->getAttrs(); in prettyPrintAttributes()
218 void DeclPrinter::prettyPrintPragmas(Decl *D) { in prettyPrintPragmas() argument
222 if (D->hasAttrs()) { in prettyPrintPragmas()
223 AttrVec &Attrs = D->getAttrs(); in prettyPrintPragmas()
279 for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); in VisitDeclContext() local
280 D != DEnd; ++D) { in VisitDeclContext()
284 if (isa<ObjCIvarDecl>(*D)) in VisitDeclContext()
288 if (D->isImplicit()) in VisitDeclContext()
299 QualType CurDeclType = getDeclType(*D); in VisitDeclContext()
306 Decls.push_back(*D); in VisitDeclContext()
317 if (isa<TagDecl>(*D) && !cast<TagDecl>(*D)->getIdentifier()) { in VisitDeclContext()
318 Decls.push_back(*D); in VisitDeclContext()
322 if (isa<AccessSpecDecl>(*D)) { in VisitDeclContext()
325 Print(D->getAccess()); in VisitDeclContext()
332 Visit(*D); in VisitDeclContext()
336 if (isa<OMPThreadPrivateDecl>(*D)) in VisitDeclContext()
338 else if (isa<FunctionDecl>(*D) && in VisitDeclContext()
339 cast<FunctionDecl>(*D)->isThisDeclarationADefinition()) in VisitDeclContext()
341 else if (isa<ObjCMethodDecl>(*D) && cast<ObjCMethodDecl>(*D)->getBody()) in VisitDeclContext()
343 else if (isa<NamespaceDecl>(*D) || isa<LinkageSpecDecl>(*D) || in VisitDeclContext()
344 isa<ObjCImplementationDecl>(*D) || in VisitDeclContext()
345 isa<ObjCInterfaceDecl>(*D) || in VisitDeclContext()
346 isa<ObjCProtocolDecl>(*D) || in VisitDeclContext()
347 isa<ObjCCategoryImplDecl>(*D) || in VisitDeclContext()
348 isa<ObjCCategoryDecl>(*D)) in VisitDeclContext()
350 else if (isa<EnumConstantDecl>(*D)) { in VisitDeclContext()
351 DeclContext::decl_iterator Next = D; in VisitDeclContext()
370 void DeclPrinter::VisitTranslationUnitDecl(TranslationUnitDecl *D) { in VisitTranslationUnitDecl() argument
371 VisitDeclContext(D, false); in VisitTranslationUnitDecl()
374 void DeclPrinter::VisitTypedefDecl(TypedefDecl *D) { in VisitTypedefDecl() argument
378 if (D->isModulePrivate()) in VisitTypedefDecl()
381 D->getTypeSourceInfo()->getType().print(Out, Policy, D->getName()); in VisitTypedefDecl()
382 prettyPrintAttributes(D); in VisitTypedefDecl()
385 void DeclPrinter::VisitTypeAliasDecl(TypeAliasDecl *D) { in VisitTypeAliasDecl() argument
386 Out << "using " << *D; in VisitTypeAliasDecl()
387 prettyPrintAttributes(D); in VisitTypeAliasDecl()
388 Out << " = " << D->getTypeSourceInfo()->getType().getAsString(Policy); in VisitTypeAliasDecl()
391 void DeclPrinter::VisitEnumDecl(EnumDecl *D) { in VisitEnumDecl() argument
392 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitEnumDecl()
395 if (D->isScoped()) { in VisitEnumDecl()
396 if (D->isScopedUsingClassTag()) in VisitEnumDecl()
401 Out << *D; in VisitEnumDecl()
403 if (D->isFixed()) in VisitEnumDecl()
404 Out << " : " << D->getIntegerType().stream(Policy); in VisitEnumDecl()
406 if (D->isCompleteDefinition()) { in VisitEnumDecl()
408 VisitDeclContext(D); in VisitEnumDecl()
411 prettyPrintAttributes(D); in VisitEnumDecl()
414 void DeclPrinter::VisitRecordDecl(RecordDecl *D) { in VisitRecordDecl() argument
415 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitRecordDecl()
417 Out << D->getKindName(); in VisitRecordDecl()
419 prettyPrintAttributes(D); in VisitRecordDecl()
421 if (D->getIdentifier()) in VisitRecordDecl()
422 Out << ' ' << *D; in VisitRecordDecl()
424 if (D->isCompleteDefinition()) { in VisitRecordDecl()
426 VisitDeclContext(D); in VisitRecordDecl()
431 void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
432 Out << *D; in VisitEnumConstantDecl()
433 if (Expr *Init = D->getInitExpr()) { in VisitEnumConstantDecl()
439 void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { in VisitFunctionDecl() argument
440 if (!D->getDescribedFunctionTemplate() && in VisitFunctionDecl()
441 !D->isFunctionTemplateSpecialization()) in VisitFunctionDecl()
442 prettyPrintPragmas(D); in VisitFunctionDecl()
444 CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D); in VisitFunctionDecl()
445 CXXConversionDecl *ConversionDecl = dyn_cast<CXXConversionDecl>(D); in VisitFunctionDecl()
447 switch (D->getStorageClass()) { in VisitFunctionDecl()
456 if (D->isInlineSpecified()) Out << "inline "; in VisitFunctionDecl()
457 if (D->isVirtualAsWritten()) Out << "virtual "; in VisitFunctionDecl()
458 if (D->isModulePrivate()) Out << "__module_private__ "; in VisitFunctionDecl()
459 if (D->isConstexpr() && !D->isExplicitlyDefaulted()) Out << "constexpr "; in VisitFunctionDecl()
467 std::string Proto = D->getNameInfo().getAsString(); in VisitFunctionDecl()
469 QualType Ty = D->getType(); in VisitFunctionDecl()
477 if (D->hasWrittenPrototype()) in VisitFunctionDecl()
484 for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { in VisitFunctionDecl()
486 ParamPrinter.VisitParmVarDecl(D->getParamDecl(i)); in VisitFunctionDecl()
490 if (D->getNumParams()) POut << ", "; in VisitFunctionDecl()
493 } else if (D->doesThisDeclarationHaveABody() && !D->hasPrototype()) { in VisitFunctionDecl()
494 for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { in VisitFunctionDecl()
497 Proto += D->getParamDecl(i)->getNameAsString(); in VisitFunctionDecl()
610 } else if (!ConversionDecl && !isa<CXXDestructorDecl>(D)) { in VisitFunctionDecl()
623 prettyPrintAttributes(D); in VisitFunctionDecl()
625 if (D->isPure()) in VisitFunctionDecl()
627 else if (D->isDeletedAsWritten()) in VisitFunctionDecl()
629 else if (D->isExplicitlyDefaulted()) in VisitFunctionDecl()
631 else if (D->doesThisDeclarationHaveABody() && !Policy.TerseOutput) { in VisitFunctionDecl()
632 if (!D->hasPrototype() && D->getNumParams()) { in VisitFunctionDecl()
638 for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { in VisitFunctionDecl()
640 ParamPrinter.VisitParmVarDecl(D->getParamDecl(i)); in VisitFunctionDecl()
647 if (D->getBody()) in VisitFunctionDecl()
648 D->getBody()->printPretty(Out, nullptr, SubPolicy, Indentation); in VisitFunctionDecl()
653 void DeclPrinter::VisitFriendDecl(FriendDecl *D) { in VisitFriendDecl() argument
654 if (TypeSourceInfo *TSI = D->getFriendType()) { in VisitFriendDecl()
655 unsigned NumTPLists = D->getFriendTypeNumTemplateParameterLists(); in VisitFriendDecl()
657 PrintTemplateParameters(D->getFriendTypeTemplateParameterList(i)); in VisitFriendDecl()
662 dyn_cast<FunctionDecl>(D->getFriendDecl())) { in VisitFriendDecl()
667 dyn_cast<FunctionTemplateDecl>(D->getFriendDecl())) { in VisitFriendDecl()
672 dyn_cast<ClassTemplateDecl>(D->getFriendDecl())) { in VisitFriendDecl()
678 void DeclPrinter::VisitFieldDecl(FieldDecl *D) { in VisitFieldDecl() argument
680 if (!Policy.SuppressSpecifiers && D->isMutable()) in VisitFieldDecl()
682 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitFieldDecl()
685 Out << D->getASTContext().getUnqualifiedObjCPointerType(D->getType()). in VisitFieldDecl()
686 stream(Policy, D->getName()); in VisitFieldDecl()
688 if (D->isBitField()) { in VisitFieldDecl()
690 D->getBitWidth()->printPretty(Out, nullptr, Policy, Indentation); in VisitFieldDecl()
693 Expr *Init = D->getInClassInitializer(); in VisitFieldDecl()
695 if (D->getInClassInitStyle() == ICIS_ListInit) in VisitFieldDecl()
701 prettyPrintAttributes(D); in VisitFieldDecl()
704 void DeclPrinter::VisitLabelDecl(LabelDecl *D) { in VisitLabelDecl() argument
705 Out << *D << ":"; in VisitLabelDecl()
708 void DeclPrinter::VisitVarDecl(VarDecl *D) { in VisitVarDecl() argument
709 prettyPrintPragmas(D); in VisitVarDecl()
711 StorageClass SC = D->getStorageClass(); in VisitVarDecl()
715 switch (D->getTSCSpec()) { in VisitVarDecl()
729 if (D->isModulePrivate()) in VisitVarDecl()
733 QualType T = D->getTypeSourceInfo() in VisitVarDecl()
734 ? D->getTypeSourceInfo()->getType() in VisitVarDecl()
735 : D->getASTContext().getUnqualifiedObjCPointerType(D->getType()); in VisitVarDecl()
736 printDeclType(T, D->getName()); in VisitVarDecl()
737 Expr *Init = D->getInit(); in VisitVarDecl()
742 if (D->getInitStyle() == VarDecl::CallInit && in VisitVarDecl()
749 if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init)) in VisitVarDecl()
751 else if (D->getInitStyle() == VarDecl::CInit) { in VisitVarDecl()
755 if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init)) in VisitVarDecl()
759 prettyPrintAttributes(D); in VisitVarDecl()
762 void DeclPrinter::VisitParmVarDecl(ParmVarDecl *D) { in VisitParmVarDecl() argument
763 VisitVarDecl(D); in VisitParmVarDecl()
766 void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { in VisitFileScopeAsmDecl() argument
768 D->getAsmString()->printPretty(Out, nullptr, Policy, Indentation); in VisitFileScopeAsmDecl()
772 void DeclPrinter::VisitImportDecl(ImportDecl *D) { in VisitImportDecl() argument
773 Out << "@import " << D->getImportedModule()->getFullModuleName() in VisitImportDecl()
777 void DeclPrinter::VisitStaticAssertDecl(StaticAssertDecl *D) { in VisitStaticAssertDecl() argument
779 D->getAssertExpr()->printPretty(Out, nullptr, Policy, Indentation); in VisitStaticAssertDecl()
780 if (StringLiteral *SL = D->getMessage()) { in VisitStaticAssertDecl()
790 void DeclPrinter::VisitNamespaceDecl(NamespaceDecl *D) { in VisitNamespaceDecl() argument
791 if (D->isInline()) in VisitNamespaceDecl()
793 Out << "namespace " << *D << " {\n"; in VisitNamespaceDecl()
794 VisitDeclContext(D); in VisitNamespaceDecl()
798 void DeclPrinter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
800 if (D->getQualifier()) in VisitUsingDirectiveDecl()
801 D->getQualifier()->print(Out, Policy); in VisitUsingDirectiveDecl()
802 Out << *D->getNominatedNamespaceAsWritten(); in VisitUsingDirectiveDecl()
805 void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { in VisitNamespaceAliasDecl() argument
806 Out << "namespace " << *D << " = "; in VisitNamespaceAliasDecl()
807 if (D->getQualifier()) in VisitNamespaceAliasDecl()
808 D->getQualifier()->print(Out, Policy); in VisitNamespaceAliasDecl()
809 Out << *D->getAliasedNamespace(); in VisitNamespaceAliasDecl()
812 void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) { in VisitEmptyDecl() argument
813 prettyPrintAttributes(D); in VisitEmptyDecl()
816 void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { in VisitCXXRecordDecl() argument
818 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitCXXRecordDecl()
820 Out << D->getKindName(); in VisitCXXRecordDecl()
822 prettyPrintAttributes(D); in VisitCXXRecordDecl()
824 if (D->getIdentifier()) in VisitCXXRecordDecl()
825 Out << ' ' << *D; in VisitCXXRecordDecl()
827 if (D->isCompleteDefinition()) { in VisitCXXRecordDecl()
829 if (D->getNumBases()) { in VisitCXXRecordDecl()
831 for (CXXRecordDecl::base_class_iterator Base = D->bases_begin(), in VisitCXXRecordDecl()
832 BaseEnd = D->bases_end(); Base != BaseEnd; ++Base) { in VisitCXXRecordDecl()
833 if (Base != D->bases_begin()) in VisitCXXRecordDecl()
854 VisitDeclContext(D); in VisitCXXRecordDecl()
859 void DeclPrinter::VisitLinkageSpecDecl(LinkageSpecDecl *D) { in VisitLinkageSpecDecl() argument
861 if (D->getLanguage() == LinkageSpecDecl::lang_c) in VisitLinkageSpecDecl()
864 assert(D->getLanguage() == LinkageSpecDecl::lang_cxx && in VisitLinkageSpecDecl()
870 if (D->hasBraces()) { in VisitLinkageSpecDecl()
872 VisitDeclContext(D); in VisitLinkageSpecDecl()
875 Visit(*D->decls_begin()); in VisitLinkageSpecDecl()
935 void DeclPrinter::VisitTemplateDecl(const TemplateDecl *D) { in VisitTemplateDecl() argument
936 PrintTemplateParameters(D->getTemplateParameters()); in VisitTemplateDecl()
939 dyn_cast<TemplateTemplateParmDecl>(D)) { in VisitTemplateDecl()
943 Out << D->getName(); in VisitTemplateDecl()
945 Visit(D->getTemplatedDecl()); in VisitTemplateDecl()
949 void DeclPrinter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
951 TemplateParameterList *Params = D->getTemplateParameters(); in VisitFunctionTemplateDecl()
952 for (auto *I : D->specializations()) { in VisitFunctionTemplateDecl()
959 prettyPrintPragmas(D->getTemplatedDecl()); in VisitFunctionTemplateDecl()
960 return VisitRedeclarableTemplateDecl(D); in VisitFunctionTemplateDecl()
963 void DeclPrinter::VisitClassTemplateDecl(ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
965 TemplateParameterList *Params = D->getTemplateParameters(); in VisitClassTemplateDecl()
966 for (auto *I : D->specializations()) { in VisitClassTemplateDecl()
973 return VisitRedeclarableTemplateDecl(D); in VisitClassTemplateDecl()
1320 void DeclPrinter::VisitUsingDecl(UsingDecl *D) { in VisitUsingDecl() argument
1321 if (!D->isAccessDeclaration()) in VisitUsingDecl()
1323 if (D->hasTypename()) in VisitUsingDecl()
1325 D->getQualifier()->print(Out, Policy); in VisitUsingDecl()
1326 Out << *D; in VisitUsingDecl()
1330 DeclPrinter::VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D) { in VisitUnresolvedUsingTypenameDecl() argument
1332 D->getQualifier()->print(Out, Policy); in VisitUnresolvedUsingTypenameDecl()
1333 Out << D->getDeclName(); in VisitUnresolvedUsingTypenameDecl()
1336 void DeclPrinter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { in VisitUnresolvedUsingValueDecl() argument
1337 if (!D->isAccessDeclaration()) in VisitUnresolvedUsingValueDecl()
1339 D->getQualifier()->print(Out, Policy); in VisitUnresolvedUsingValueDecl()
1340 Out << D->getDeclName(); in VisitUnresolvedUsingValueDecl()
1343 void DeclPrinter::VisitUsingShadowDecl(UsingShadowDecl *D) { in VisitUsingShadowDecl() argument
1347 void DeclPrinter::VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D) { in VisitOMPThreadPrivateDecl() argument
1349 if (!D->varlist_empty()) { in VisitOMPThreadPrivateDecl()
1350 for (OMPThreadPrivateDecl::varlist_iterator I = D->varlist_begin(), in VisitOMPThreadPrivateDecl()
1351 E = D->varlist_end(); in VisitOMPThreadPrivateDecl()
1353 Out << (I == D->varlist_begin() ? '(' : ','); in VisitOMPThreadPrivateDecl()