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);
95 void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D);
96 void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D);
100 void prettyPrintAttributes(Decl *D);
101 void prettyPrintPragmas(Decl *D);
143 static QualType getDeclType(Decl* D) { in getDeclType() argument
144 if (TypedefNameDecl* TDD = dyn_cast<TypedefNameDecl>(D)) in getDeclType()
146 if (ValueDecl* VD = dyn_cast<ValueDecl>(D)) in getDeclType()
200 void DeclPrinter::prettyPrintAttributes(Decl *D) { in prettyPrintAttributes() argument
204 if (D->hasAttrs()) { in prettyPrintAttributes()
205 AttrVec &Attrs = D->getAttrs(); in prettyPrintAttributes()
220 void DeclPrinter::prettyPrintPragmas(Decl *D) { in prettyPrintPragmas() argument
224 if (D->hasAttrs()) { in prettyPrintPragmas()
225 AttrVec &Attrs = D->getAttrs(); in prettyPrintPragmas()
281 for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); in VisitDeclContext() local
282 D != DEnd; ++D) { in VisitDeclContext()
286 if (isa<ObjCIvarDecl>(*D)) in VisitDeclContext()
290 if (D->isImplicit()) in VisitDeclContext()
301 QualType CurDeclType = getDeclType(*D); in VisitDeclContext()
308 Decls.push_back(*D); in VisitDeclContext()
319 if (isa<TagDecl>(*D) && !cast<TagDecl>(*D)->getIdentifier()) { in VisitDeclContext()
320 Decls.push_back(*D); in VisitDeclContext()
324 if (isa<AccessSpecDecl>(*D)) { in VisitDeclContext()
327 Print(D->getAccess()); in VisitDeclContext()
334 Visit(*D); in VisitDeclContext()
338 if (isa<OMPThreadPrivateDecl>(*D) || isa<OMPDeclareReductionDecl>(*D)) in VisitDeclContext()
340 else if (isa<FunctionDecl>(*D) && in VisitDeclContext()
341 cast<FunctionDecl>(*D)->isThisDeclarationADefinition()) in VisitDeclContext()
343 else if (isa<ObjCMethodDecl>(*D) && cast<ObjCMethodDecl>(*D)->getBody()) in VisitDeclContext()
345 else if (isa<NamespaceDecl>(*D) || isa<LinkageSpecDecl>(*D) || in VisitDeclContext()
346 isa<ObjCImplementationDecl>(*D) || in VisitDeclContext()
347 isa<ObjCInterfaceDecl>(*D) || in VisitDeclContext()
348 isa<ObjCProtocolDecl>(*D) || in VisitDeclContext()
349 isa<ObjCCategoryImplDecl>(*D) || in VisitDeclContext()
350 isa<ObjCCategoryDecl>(*D)) in VisitDeclContext()
352 else if (isa<EnumConstantDecl>(*D)) { in VisitDeclContext()
353 DeclContext::decl_iterator Next = D; in VisitDeclContext()
366 if (D->hasAttr<OMPDeclareTargetDeclAttr>()) in VisitDeclContext()
377 void DeclPrinter::VisitTranslationUnitDecl(TranslationUnitDecl *D) { in VisitTranslationUnitDecl() argument
378 VisitDeclContext(D, false); in VisitTranslationUnitDecl()
381 void DeclPrinter::VisitTypedefDecl(TypedefDecl *D) { in VisitTypedefDecl() argument
385 if (D->isModulePrivate()) in VisitTypedefDecl()
388 QualType Ty = D->getTypeSourceInfo()->getType(); in VisitTypedefDecl()
389 Ty.print(Out, Policy, D->getName(), Indentation); in VisitTypedefDecl()
390 prettyPrintAttributes(D); in VisitTypedefDecl()
393 void DeclPrinter::VisitTypeAliasDecl(TypeAliasDecl *D) { in VisitTypeAliasDecl() argument
394 Out << "using " << *D; in VisitTypeAliasDecl()
395 prettyPrintAttributes(D); in VisitTypeAliasDecl()
396 Out << " = " << D->getTypeSourceInfo()->getType().getAsString(Policy); in VisitTypeAliasDecl()
399 void DeclPrinter::VisitEnumDecl(EnumDecl *D) { in VisitEnumDecl() argument
400 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitEnumDecl()
403 if (D->isScoped()) { in VisitEnumDecl()
404 if (D->isScopedUsingClassTag()) in VisitEnumDecl()
409 Out << *D; in VisitEnumDecl()
411 if (D->isFixed()) in VisitEnumDecl()
412 Out << " : " << D->getIntegerType().stream(Policy); in VisitEnumDecl()
414 if (D->isCompleteDefinition()) { in VisitEnumDecl()
416 VisitDeclContext(D); in VisitEnumDecl()
419 prettyPrintAttributes(D); in VisitEnumDecl()
422 void DeclPrinter::VisitRecordDecl(RecordDecl *D) { in VisitRecordDecl() argument
423 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitRecordDecl()
425 Out << D->getKindName(); in VisitRecordDecl()
427 prettyPrintAttributes(D); in VisitRecordDecl()
429 if (D->getIdentifier()) in VisitRecordDecl()
430 Out << ' ' << *D; in VisitRecordDecl()
432 if (D->isCompleteDefinition()) { in VisitRecordDecl()
434 VisitDeclContext(D); in VisitRecordDecl()
439 void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
440 Out << *D; in VisitEnumConstantDecl()
441 if (Expr *Init = D->getInitExpr()) { in VisitEnumConstantDecl()
447 void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { in VisitFunctionDecl() argument
448 if (!D->getDescribedFunctionTemplate() && in VisitFunctionDecl()
449 !D->isFunctionTemplateSpecialization()) in VisitFunctionDecl()
450 prettyPrintPragmas(D); in VisitFunctionDecl()
452 CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D); in VisitFunctionDecl()
453 CXXConversionDecl *ConversionDecl = dyn_cast<CXXConversionDecl>(D); in VisitFunctionDecl()
455 switch (D->getStorageClass()) { in VisitFunctionDecl()
464 if (D->isInlineSpecified()) Out << "inline "; in VisitFunctionDecl()
465 if (D->isVirtualAsWritten()) Out << "virtual "; in VisitFunctionDecl()
466 if (D->isModulePrivate()) Out << "__module_private__ "; in VisitFunctionDecl()
467 if (D->isConstexpr() && !D->isExplicitlyDefaulted()) Out << "constexpr "; in VisitFunctionDecl()
475 std::string Proto = D->getNameInfo().getAsString(); in VisitFunctionDecl()
477 QualType Ty = D->getType(); in VisitFunctionDecl()
485 if (D->hasWrittenPrototype()) in VisitFunctionDecl()
492 for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { in VisitFunctionDecl()
494 ParamPrinter.VisitParmVarDecl(D->getParamDecl(i)); in VisitFunctionDecl()
498 if (D->getNumParams()) POut << ", "; in VisitFunctionDecl()
501 } else if (D->doesThisDeclarationHaveABody() && !D->hasPrototype()) { in VisitFunctionDecl()
502 for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { in VisitFunctionDecl()
505 Proto += D->getParamDecl(i)->getNameAsString(); in VisitFunctionDecl()
618 } else if (!ConversionDecl && !isa<CXXDestructorDecl>(D)) { in VisitFunctionDecl()
631 prettyPrintAttributes(D); in VisitFunctionDecl()
633 if (D->isPure()) in VisitFunctionDecl()
635 else if (D->isDeletedAsWritten()) in VisitFunctionDecl()
637 else if (D->isExplicitlyDefaulted()) in VisitFunctionDecl()
639 else if (D->doesThisDeclarationHaveABody() && !Policy.TerseOutput) { in VisitFunctionDecl()
640 if (!D->hasPrototype() && D->getNumParams()) { in VisitFunctionDecl()
646 for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { in VisitFunctionDecl()
648 ParamPrinter.VisitParmVarDecl(D->getParamDecl(i)); in VisitFunctionDecl()
655 if (D->getBody()) in VisitFunctionDecl()
656 D->getBody()->printPretty(Out, nullptr, SubPolicy, Indentation); in VisitFunctionDecl()
661 void DeclPrinter::VisitFriendDecl(FriendDecl *D) { in VisitFriendDecl() argument
662 if (TypeSourceInfo *TSI = D->getFriendType()) { in VisitFriendDecl()
663 unsigned NumTPLists = D->getFriendTypeNumTemplateParameterLists(); in VisitFriendDecl()
665 PrintTemplateParameters(D->getFriendTypeTemplateParameterList(i)); in VisitFriendDecl()
670 dyn_cast<FunctionDecl>(D->getFriendDecl())) { in VisitFriendDecl()
675 dyn_cast<FunctionTemplateDecl>(D->getFriendDecl())) { in VisitFriendDecl()
680 dyn_cast<ClassTemplateDecl>(D->getFriendDecl())) { in VisitFriendDecl()
686 void DeclPrinter::VisitFieldDecl(FieldDecl *D) { in VisitFieldDecl() argument
688 if (!Policy.SuppressSpecifiers && D->isMutable()) in VisitFieldDecl()
690 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitFieldDecl()
693 Out << D->getASTContext().getUnqualifiedObjCPointerType(D->getType()). in VisitFieldDecl()
694 stream(Policy, D->getName(), Indentation); in VisitFieldDecl()
696 if (D->isBitField()) { in VisitFieldDecl()
698 D->getBitWidth()->printPretty(Out, nullptr, Policy, Indentation); in VisitFieldDecl()
701 Expr *Init = D->getInClassInitializer(); in VisitFieldDecl()
703 if (D->getInClassInitStyle() == ICIS_ListInit) in VisitFieldDecl()
709 prettyPrintAttributes(D); in VisitFieldDecl()
712 void DeclPrinter::VisitLabelDecl(LabelDecl *D) { in VisitLabelDecl() argument
713 Out << *D << ":"; in VisitLabelDecl()
716 void DeclPrinter::VisitVarDecl(VarDecl *D) { in VisitVarDecl() argument
717 prettyPrintPragmas(D); in VisitVarDecl()
719 QualType T = D->getTypeSourceInfo() in VisitVarDecl()
720 ? D->getTypeSourceInfo()->getType() in VisitVarDecl()
721 : D->getASTContext().getUnqualifiedObjCPointerType(D->getType()); in VisitVarDecl()
724 StorageClass SC = D->getStorageClass(); in VisitVarDecl()
728 switch (D->getTSCSpec()) { in VisitVarDecl()
742 if (D->isModulePrivate()) in VisitVarDecl()
745 if (D->isConstexpr()) { in VisitVarDecl()
751 printDeclType(T, D->getName()); in VisitVarDecl()
752 Expr *Init = D->getInit(); in VisitVarDecl()
757 if (D->getInitStyle() == VarDecl::CallInit && in VisitVarDecl()
764 if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init)) in VisitVarDecl()
766 else if (D->getInitStyle() == VarDecl::CInit) { in VisitVarDecl()
773 if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init)) in VisitVarDecl()
777 prettyPrintAttributes(D); in VisitVarDecl()
780 void DeclPrinter::VisitParmVarDecl(ParmVarDecl *D) { in VisitParmVarDecl() argument
781 VisitVarDecl(D); in VisitParmVarDecl()
784 void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { in VisitFileScopeAsmDecl() argument
786 D->getAsmString()->printPretty(Out, nullptr, Policy, Indentation); in VisitFileScopeAsmDecl()
790 void DeclPrinter::VisitImportDecl(ImportDecl *D) { in VisitImportDecl() argument
791 Out << "@import " << D->getImportedModule()->getFullModuleName() in VisitImportDecl()
795 void DeclPrinter::VisitStaticAssertDecl(StaticAssertDecl *D) { in VisitStaticAssertDecl() argument
797 D->getAssertExpr()->printPretty(Out, nullptr, Policy, Indentation); in VisitStaticAssertDecl()
798 if (StringLiteral *SL = D->getMessage()) { in VisitStaticAssertDecl()
808 void DeclPrinter::VisitNamespaceDecl(NamespaceDecl *D) { in VisitNamespaceDecl() argument
809 if (D->isInline()) in VisitNamespaceDecl()
811 Out << "namespace " << *D << " {\n"; in VisitNamespaceDecl()
812 VisitDeclContext(D); in VisitNamespaceDecl()
816 void DeclPrinter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
818 if (D->getQualifier()) in VisitUsingDirectiveDecl()
819 D->getQualifier()->print(Out, Policy); in VisitUsingDirectiveDecl()
820 Out << *D->getNominatedNamespaceAsWritten(); in VisitUsingDirectiveDecl()
823 void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { in VisitNamespaceAliasDecl() argument
824 Out << "namespace " << *D << " = "; in VisitNamespaceAliasDecl()
825 if (D->getQualifier()) in VisitNamespaceAliasDecl()
826 D->getQualifier()->print(Out, Policy); in VisitNamespaceAliasDecl()
827 Out << *D->getAliasedNamespace(); in VisitNamespaceAliasDecl()
830 void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) { in VisitEmptyDecl() argument
831 prettyPrintAttributes(D); in VisitEmptyDecl()
834 void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { in VisitCXXRecordDecl() argument
836 if (!Policy.SuppressSpecifiers && D->isModulePrivate()) in VisitCXXRecordDecl()
838 Out << D->getKindName(); in VisitCXXRecordDecl()
840 prettyPrintAttributes(D); in VisitCXXRecordDecl()
842 if (D->getIdentifier()) in VisitCXXRecordDecl()
843 Out << ' ' << *D; in VisitCXXRecordDecl()
845 if (D->isCompleteDefinition()) { in VisitCXXRecordDecl()
847 if (D->getNumBases()) { in VisitCXXRecordDecl()
849 for (CXXRecordDecl::base_class_iterator Base = D->bases_begin(), in VisitCXXRecordDecl()
850 BaseEnd = D->bases_end(); Base != BaseEnd; ++Base) { in VisitCXXRecordDecl()
851 if (Base != D->bases_begin()) in VisitCXXRecordDecl()
872 VisitDeclContext(D); in VisitCXXRecordDecl()
877 void DeclPrinter::VisitLinkageSpecDecl(LinkageSpecDecl *D) { in VisitLinkageSpecDecl() argument
879 if (D->getLanguage() == LinkageSpecDecl::lang_c) in VisitLinkageSpecDecl()
882 assert(D->getLanguage() == LinkageSpecDecl::lang_cxx && in VisitLinkageSpecDecl()
888 if (D->hasBraces()) { in VisitLinkageSpecDecl()
890 VisitDeclContext(D); in VisitLinkageSpecDecl()
893 Visit(*D->decls_begin()); in VisitLinkageSpecDecl()
953 void DeclPrinter::VisitTemplateDecl(const TemplateDecl *D) { in VisitTemplateDecl() argument
954 PrintTemplateParameters(D->getTemplateParameters()); in VisitTemplateDecl()
957 dyn_cast<TemplateTemplateParmDecl>(D)) { in VisitTemplateDecl()
961 Out << D->getName(); in VisitTemplateDecl()
963 Visit(D->getTemplatedDecl()); in VisitTemplateDecl()
967 void DeclPrinter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
969 TemplateParameterList *Params = D->getTemplateParameters(); in VisitFunctionTemplateDecl()
970 for (auto *I : D->specializations()) { in VisitFunctionTemplateDecl()
977 prettyPrintPragmas(D->getTemplatedDecl()); in VisitFunctionTemplateDecl()
978 return VisitRedeclarableTemplateDecl(D); in VisitFunctionTemplateDecl()
981 void DeclPrinter::VisitClassTemplateDecl(ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
983 TemplateParameterList *Params = D->getTemplateParameters(); in VisitClassTemplateDecl()
984 for (auto *I : D->specializations()) { in VisitClassTemplateDecl()
991 return VisitRedeclarableTemplateDecl(D); in VisitClassTemplateDecl()
1343 void DeclPrinter::VisitUsingDecl(UsingDecl *D) { in VisitUsingDecl() argument
1344 if (!D->isAccessDeclaration()) in VisitUsingDecl()
1346 if (D->hasTypename()) in VisitUsingDecl()
1348 D->getQualifier()->print(Out, Policy); in VisitUsingDecl()
1349 Out << *D; in VisitUsingDecl()
1353 DeclPrinter::VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D) { in VisitUnresolvedUsingTypenameDecl() argument
1355 D->getQualifier()->print(Out, Policy); in VisitUnresolvedUsingTypenameDecl()
1356 Out << D->getDeclName(); in VisitUnresolvedUsingTypenameDecl()
1359 void DeclPrinter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { in VisitUnresolvedUsingValueDecl() argument
1360 if (!D->isAccessDeclaration()) in VisitUnresolvedUsingValueDecl()
1362 D->getQualifier()->print(Out, Policy); in VisitUnresolvedUsingValueDecl()
1363 Out << D->getDeclName(); in VisitUnresolvedUsingValueDecl()
1366 void DeclPrinter::VisitUsingShadowDecl(UsingShadowDecl *D) { in VisitUsingShadowDecl() argument
1370 void DeclPrinter::VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D) { in VisitOMPThreadPrivateDecl() argument
1372 if (!D->varlist_empty()) { in VisitOMPThreadPrivateDecl()
1373 for (OMPThreadPrivateDecl::varlist_iterator I = D->varlist_begin(), in VisitOMPThreadPrivateDecl()
1374 E = D->varlist_end(); in VisitOMPThreadPrivateDecl()
1376 Out << (I == D->varlist_begin() ? '(' : ','); in VisitOMPThreadPrivateDecl()
1384 void DeclPrinter::VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D) { in VisitOMPDeclareReductionDecl() argument
1385 if (!D->isInvalidDecl()) { in VisitOMPDeclareReductionDecl()
1387 if (D->getDeclName().getNameKind() == DeclarationName::CXXOperatorName) { in VisitOMPDeclareReductionDecl()
1395 OperatorNames[D->getDeclName().getCXXOverloadedOperator()]; in VisitOMPDeclareReductionDecl()
1399 assert(D->getDeclName().isIdentifier()); in VisitOMPDeclareReductionDecl()
1400 D->printName(Out); in VisitOMPDeclareReductionDecl()
1403 D->getType().print(Out, Policy); in VisitOMPDeclareReductionDecl()
1405 D->getCombiner()->printPretty(Out, nullptr, Policy, 0); in VisitOMPDeclareReductionDecl()
1407 if (auto *Init = D->getInitializer()) { in VisitOMPDeclareReductionDecl()
1415 void DeclPrinter::VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D) { in VisitOMPCapturedExprDecl() argument
1416 D->getInit()->printPretty(Out, nullptr, Policy, Indentation); in VisitOMPCapturedExprDecl()