29 #include "llvm/Support/raw_ostream.h"
30 using namespace clang;
31 using namespace clang::comments;
41 struct TerminalColor {
42 raw_ostream::Colors Color;
57 static const TerminalColor DeclKindNameColor = { raw_ostream::GREEN,
true };
59 static const TerminalColor AttrColor = { raw_ostream::BLUE,
true };
61 static const TerminalColor StmtColor = { raw_ostream::MAGENTA,
true };
63 static const TerminalColor CommentColor = { raw_ostream::BLUE,
false };
66 static const TerminalColor TypeColor = { raw_ostream::GREEN,
false };
69 static const TerminalColor AddressColor = { raw_ostream::YELLOW,
false };
71 static const TerminalColor LocationColor = { raw_ostream::YELLOW,
false };
74 static const TerminalColor ValueKindColor = { raw_ostream::CYAN,
false };
76 static const TerminalColor ObjectKindColor = { raw_ostream::CYAN,
false };
79 static const TerminalColor NullColor = { raw_ostream::BLUE,
false };
82 static const TerminalColor UndeserializedColor = { raw_ostream::GREEN,
true };
85 static const TerminalColor CastColor = { raw_ostream::RED,
false };
88 static const TerminalColor ValueColor = { raw_ostream::CYAN,
true };
90 static const TerminalColor DeclNameColor = { raw_ostream::CYAN,
true };
93 static const TerminalColor IndentColor = { raw_ostream::BLUE,
false };
116 const char *LastLocFilename;
117 unsigned LastLocLine;
125 template<
typename Fn>
void dumpChild(Fn doDumpChild) {
131 while (!Pending.empty()) {
132 Pending.back()(
true);
142 auto dumpWithIndent = [
this, doDumpChild, OrigFC](
bool isLastChild) {
157 ColorScope Color(*
this, IndentColor);
158 OS << Prefix << (isLastChild ?
'`' :
'|') <<
'-';
159 this->Prefix.push_back(isLastChild ?
' ' :
'|');
160 this->Prefix.push_back(
' ');
164 unsigned Depth = Pending.size();
171 while (Depth < Pending.size()) {
172 Pending.back()(
true);
173 this->Pending.pop_back();
177 this->Prefix.resize(Prefix.size() - 2);
181 Pending.push_back(std::move(dumpWithIndent));
183 Pending.back()(
false);
184 Pending.back() = std::move(dumpWithIndent);
192 ColorScope(ASTDumper &Dumper, TerminalColor Color)
194 if (Dumper.ShowColors)
195 Dumper.OS.changeColor(Color.Color, Color.Bold);
198 if (Dumper.ShowColors)
199 Dumper.OS.resetColor();
206 : OS(OS), Traits(Traits), SM(SM), TopLevel(
true), FirstChild(
true),
207 LastLocFilename(
""), LastLocLine(~0U), FC(nullptr),
208 ShowColors(SM && SM->getDiagnostics().getShowColors()) { }
212 : OS(OS), Traits(Traits), SM(SM), TopLevel(
true), FirstChild(
true),
213 LastLocFilename(
""), LastLocLine(~0U),
214 ShowColors(ShowColors) { }
216 void dumpDecl(
const Decl *D);
217 void dumpStmt(
const Stmt *
S);
221 void dumpPointer(
const void *Ptr);
227 void dumpTypeAsChild(
const Type *T);
228 void dumpBareDeclRef(
const Decl *
Node);
229 void dumpDeclRef(
const Decl *
Node,
const char *Label =
nullptr);
233 void dumpLookups(
const DeclContext *DC,
bool DumpDecls);
234 void dumpAttr(
const Attr *A);
264 OS <<
" written as lvalue reference";
265 VisitReferenceType(T);
271 void VisitArrayType(
const ArrayType *T) {
296 void VisitDependentSizedExtVectorType(
317 if (EI.getNoReturn()) OS <<
" noreturn";
318 if (EI.getProducesResult()) OS <<
" produces_result";
319 if (EI.getHasRegParm()) OS <<
" regparm " << EI.
getRegParm();
325 if (EPI.HasTrailingReturn) OS <<
" trailing_return";
326 if (T->
isConst()) OS <<
" const";
329 switch (EPI.RefQualifier) {
336 VisitFunctionType(T);
340 dumpChild([=] { OS <<
"..."; });
357 OS <<
" underlying_type";
362 void VisitTagType(
const TagType *T) {
377 void VisitSubstTemplateTypeParmPackType(
382 void VisitAutoType(
const AutoType *T) {
388 if (T->isTypeAlias()) OS <<
" alias";
389 OS <<
" "; T->getTemplateName().dump(OS);
391 dumpTemplateArgument(Arg);
392 if (T->isTypeAlias())
393 dumpTypeAsChild(T->getAliasedType());
407 void VisitPipeType(
const PipeType *T) {
424 void VisitEnumDecl(
const EnumDecl *D);
430 void VisitVarDecl(
const VarDecl *D);
450 template<
typename SpecializationDecl>
451 void VisitTemplateDeclSpecialization(
const SpecializationDecl *D,
452 bool DumpExplicitInst,
454 template<
typename TemplateDecl>
455 void VisitTemplateDecl(
const TemplateDecl *D,
bool DumpExplicitInst);
458 void VisitClassTemplateSpecializationDecl(
460 void VisitClassTemplatePartialSpecializationDecl(
462 void VisitClassScopeFunctionSpecializationDecl(
466 void VisitVarTemplateSpecializationDecl(
468 void VisitVarTemplatePartialSpecializationDecl(
560 const char *getCommandName(
unsigned CommandID);
561 void dumpComment(
const Comment *C);
583 void ASTDumper::dumpPointer(
const void *Ptr) {
584 ColorScope Color(*
this, AddressColor);
592 ColorScope Color(*
this, LocationColor);
600 OS <<
"<invalid sloc>";
604 if (strcmp(PLoc.
getFilename(), LastLocFilename) != 0) {
609 }
else if (PLoc.
getLine() != LastLocLine) {
610 OS <<
"line" <<
':' << PLoc.
getLine()
636 ColorScope Color(*
this, TypeColor);
641 if (Desugar && !T.
isNull()) {
644 if (T_split != D_split)
649 void ASTDumper::dumpType(
QualType T) {
654 void ASTDumper::dumpTypeAsChild(
QualType T) {
657 return dumpTypeAsChild(SQT.
Ty);
663 dumpBareType(T,
false);
669 void ASTDumper::dumpTypeAsChild(
const Type *T) {
672 ColorScope Color(*
this, NullColor);
676 if (
const LocInfoType *LIT = llvm::dyn_cast<LocInfoType>(T)) {
678 ColorScope Color(*
this, TypeColor);
679 OS <<
"LocInfo Type";
682 dumpTypeAsChild(LIT->getTypeSourceInfo()->getType());
687 ColorScope Color(*
this, TypeColor);
692 dumpBareType(
QualType(T, 0),
false);
696 if (SingleStepDesugar !=
QualType(T, 0))
701 OS <<
" instantiation_dependent";
703 OS <<
" variably_modified";
705 OS <<
" contains_unexpanded_pack";
711 if (SingleStepDesugar !=
QualType(T, 0))
712 dumpTypeAsChild(SingleStepDesugar);
716 void ASTDumper::dumpBareDeclRef(
const Decl *D) {
718 ColorScope Color(*
this, NullColor);
724 ColorScope Color(*
this, DeclKindNameColor);
725 OS << D->getDeclKindName();
729 if (
const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
730 ColorScope Color(*
this, DeclNameColor);
731 OS <<
" '" << ND->getDeclName() <<
'\'';
734 if (
const ValueDecl *VD = dyn_cast<ValueDecl>(D))
735 dumpType(VD->getType());
738 void ASTDumper::dumpDeclRef(
const Decl *D,
const char *Label) {
749 void ASTDumper::dumpName(
const NamedDecl *ND) {
751 ColorScope Color(*
this, DeclNameColor);
764 void ASTDumper::dumpDeclContext(
const DeclContext *DC) {
773 ColorScope Color(*
this, UndeserializedColor);
774 OS <<
"<undeserialized declarations>";
779 void ASTDumper::dumpLookups(
const DeclContext *DC,
bool DumpDecls) {
781 OS <<
"StoredDeclsMap ";
782 dumpBareDeclRef(cast<Decl>(DC));
787 dumpPointer(cast<Decl>(Primary));
799 OS <<
"DeclarationName ";
801 ColorScope Color(*
this, DeclNameColor);
802 OS <<
'\'' << Name <<
'\'';
808 dumpBareDeclRef(*RI);
810 if ((*RI)->isHidden())
816 std::function<void(Decl *)> DumpWithPrev = [&](
Decl *D) {
817 if (
Decl *Prev = D->getPreviousDecl())
828 if (HasUndeserializedLookups) {
830 ColorScope Color(*
this, UndeserializedColor);
831 OS <<
"<undeserialized lookups>";
837 void ASTDumper::dumpAttr(
const Attr *A) {
840 ColorScope Color(*
this, AttrColor);
843 #define ATTR(X) case attr::X: OS << #X; break;
844 #include "clang/Basic/AttrList.inc"
854 #include "clang/AST/AttrDump.inc"
864 OS <<
" first " << First;
871 OS <<
" prev " << Prev;
877 switch (D->getKind()) {
878 #define DECL(DERIVED, BASE) \
879 case Decl::DERIVED: \
880 return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
881 #define ABSTRACT_DECL(DECL)
882 #include "clang/AST/DeclNodes.inc"
884 llvm_unreachable(
"Decl that isn't part of DeclNodes.inc!");
909 OS <<
"CXXCtorInitializer";
918 llvm_unreachable(
"Unknown initializer type");
933 void ASTDumper::dumpTemplateArgumentListInfo(
935 for (
unsigned i = 0, e = TALI.
size(); i < e; ++i)
936 dumpTemplateArgumentLoc(TALI[i]);
944 for (
unsigned i = 0, e = TAL.
size(); i < e; ++i)
945 dumpTemplateArgument(TAL[i]);
950 OS <<
"TemplateArgument";
977 OS <<
" template expansion";
988 dumpTemplateArgument(*I);
1001 for (
auto typeParam : *typeParams) {
1002 dumpDecl(typeParam);
1010 void ASTDumper::dumpDecl(
const Decl *D) {
1013 ColorScope Color(*
this, NullColor);
1019 ColorScope Color(*
this, DeclKindNameColor);
1020 OS << D->getDeclKindName() <<
"Decl";
1023 if (D->getLexicalDeclContext() != D->getDeclContext())
1024 OS <<
" parent " << cast<Decl>(D->getDeclContext());
1026 dumpSourceRange(D->getSourceRange());
1028 dumpLocation(D->getLocation());
1029 if (
Module *M = D->getImportedOwningModule())
1030 OS <<
" in " << M->getFullModuleName();
1031 else if (
Module *M = D->getLocalOwningModule())
1032 OS <<
" in (local) " << M->getFullModuleName();
1033 if (
auto *ND = dyn_cast<NamedDecl>(D))
1034 for (
Module *M : D->getASTContext().getModulesWithMergedDefinition(
1035 const_cast<NamedDecl *>(ND)))
1036 dumpChild([=] { OS <<
"also in " << M->getFullModuleName(); });
1037 if (
const NamedDecl *ND = dyn_cast<NamedDecl>(D))
1040 if (D->isImplicit())
1044 else if (D->isThisDeclarationReferenced())
1045 OS <<
" referenced";
1046 if (D->isInvalidDecl())
1048 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
1049 if (FD->isConstexpr())
1055 for (Decl::attr_iterator I = D->attr_begin(),
E = D->attr_end(); I !=
E;
1060 D->getASTContext().getLocalCommentForDeclUncached(D))
1064 if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D) &&
1065 hasNodes(dyn_cast<DeclContext>(D)))
1066 dumpDeclContext(cast<DeclContext>(D));
1070 void ASTDumper::VisitLabelDecl(
const LabelDecl *D) {
1074 void ASTDumper::VisitTypedefDecl(
const TypedefDecl *D) {
1077 if (D->isModulePrivate())
1078 OS <<
" __module_private__";
1082 void ASTDumper::VisitEnumDecl(
const EnumDecl *D) {
1090 if (D->isModulePrivate())
1091 OS <<
" __module_private__";
1096 void ASTDumper::VisitRecordDecl(
const RecordDecl *D) {
1099 if (D->isModulePrivate())
1100 OS <<
" __module_private__";
1102 OS <<
" definition";
1116 for (
auto *Child : D->
chain())
1120 void ASTDumper::VisitFunctionDecl(
const FunctionDecl *D) {
1131 if (D->isModulePrivate())
1132 OS <<
" __module_private__";
1154 dumpTemplateArgumentList(*FTSI->TemplateArguments);
1162 dumpChild([=] { OS <<
"<<NULL params x " << D->
getNumParams() <<
">>"; });
1165 dumpDecl(Parameter);
1171 dumpCXXCtorInitializer(*I);
1177 void ASTDumper::VisitFieldDecl(
const FieldDecl *D) {
1182 if (D->isModulePrivate())
1183 OS <<
" __module_private__";
1191 void ASTDumper::VisitVarDecl(
const VarDecl *D) {
1202 if (D->isModulePrivate())
1203 OS <<
" __module_private__";
1224 void ASTDumper::VisitImportDecl(
const ImportDecl *D) {
1231 case PCK_Unknown: llvm_unreachable(
"unexpected pragma comment kind");
1234 case PCK_Lib: OS <<
"lib";
break;
1236 case PCK_User: OS <<
"user";
break;
1238 StringRef Arg = D->
getArg();
1240 OS <<
" \"" << Arg <<
"\"";
1243 void ASTDumper::VisitPragmaDetectMismatchDecl(
1248 void ASTDumper::VisitCapturedDecl(
const CapturedDecl *D) {
1267 OS <<
" initializer";
1268 dumpStmt(Initializer);
1282 void ASTDumper::VisitNamespaceDecl(
const NamespaceDecl *D) {
1300 void ASTDumper::VisitTypeAliasDecl(
const TypeAliasDecl *D) {
1312 void ASTDumper::VisitCXXRecordDecl(
const CXXRecordDecl *D) {
1317 for (
const auto &I : D->
bases()) {
1321 dumpAccessSpecifier(I.getAccessSpecifier());
1322 dumpType(I.getType());
1323 if (I.isPackExpansion())
1334 template<
typename SpecializationDecl>
1335 void ASTDumper::VisitTemplateDeclSpecialization(
const SpecializationDecl *D,
1336 bool DumpExplicitInst,
1338 bool DumpedAny =
false;
1339 for (
auto *RedeclWithBadType : D->redecls()) {
1343 auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
1347 assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
1348 "expected an injected-class-name");
1352 switch (Redecl->getTemplateSpecializationKind()) {
1355 if (!DumpExplicitInst)
1361 dumpDeclRef(Redecl);
1376 template<
typename TemplateDecl>
1377 void ASTDumper::VisitTemplateDecl(
const TemplateDecl *D,
1378 bool DumpExplicitInst) {
1384 for (
auto *Child : D->specializations())
1385 VisitTemplateDeclSpecialization(Child, DumpExplicitInst,
1386 !D->isCanonicalDecl());
1393 VisitTemplateDecl(D,
true);
1397 VisitTemplateDecl(D,
false);
1400 void ASTDumper::VisitClassTemplateSpecializationDecl(
1402 VisitCXXRecordDecl(D);
1406 void ASTDumper::VisitClassTemplatePartialSpecializationDecl(
1408 VisitClassTemplateSpecializationDecl(D);
1412 void ASTDumper::VisitClassScopeFunctionSpecializationDecl(
1420 VisitTemplateDecl(D,
false);
1428 void ASTDumper::VisitVarTemplateSpecializationDecl(
1434 void ASTDumper::VisitVarTemplatePartialSpecializationDecl(
1437 VisitVarTemplateSpecializationDecl(D);
1461 void ASTDumper::VisitTemplateTemplateParmDecl(
1471 void ASTDumper::VisitUsingDecl(
const UsingDecl *D) {
1478 void ASTDumper::VisitUnresolvedUsingTypenameDecl(
1498 dumpTypeAsChild(TD->getTypeForDecl());
1501 void ASTDumper::VisitConstructorUsingShadowDecl(
1519 OS <<
"constructed ";
1535 dumpAccessSpecifier(D->getAccess());
1538 void ASTDumper::VisitFriendDecl(
const FriendDecl *D) {
1540 dumpType(T->getType());
1549 void ASTDumper::VisitObjCIvarDecl(
const ObjCIvarDecl *D) {
1553 OS <<
" synthesize";
1586 dumpDecl(Parameter);
1590 dumpChild([=] { OS <<
"..."; });
1607 OS <<
" contravariant";
1657 dumpCXXCtorInitializer(*I);
1695 OS <<
" unsafe_unretained";
1708 OS <<
" synthesize";
1715 void ASTDumper::VisitBlockDecl(
const BlockDecl *D) {
1720 dumpChild([=]{ OS <<
"..."; });
1723 dumpChild([=]{ OS <<
"capture this"; });
1725 for (
const auto &I : D->
captures()) {
1732 if (I.getVariable()) {
1734 dumpBareDeclRef(I.getVariable());
1736 if (I.hasCopyExpr())
1737 dumpStmt(I.getCopyExpr());
1747 void ASTDumper::dumpStmt(
const Stmt *
S) {
1750 ColorScope Color(*
this, NullColor);
1755 if (
const DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
1762 for (
const Stmt *SubStmt : S->children())
1767 void ASTDumper::VisitStmt(
const Stmt *
Node) {
1769 ColorScope Color(*
this, StmtColor);
1770 OS << Node->getStmtClassName();
1773 dumpSourceRange(Node->getSourceRange());
1776 void ASTDumper::VisitDeclStmt(
const DeclStmt *Node) {
1784 void ASTDumper::VisitAttributedStmt(
const AttributedStmt *Node) {
1792 void ASTDumper::VisitLabelStmt(
const LabelStmt *Node) {
1794 OS <<
" '" << Node->
getName() <<
"'";
1797 void ASTDumper::VisitGotoStmt(
const GotoStmt *Node) {
1803 void ASTDumper::VisitCXXCatchStmt(
const CXXCatchStmt *Node) {
1808 void ASTDumper::VisitCapturedStmt(
const CapturedStmt *Node) {
1817 void ASTDumper::VisitOMPExecutableDirective(
1820 for (
auto *C : Node->
clauses()) {
1823 ColorScope Color(*
this, NullColor);
1824 OS <<
"<<<NULL>>> OMPClause";
1828 ColorScope Color(*
this, AttrColor);
1830 OS <<
"OMP" << ClauseName.substr(0, 1).upper()
1831 << ClauseName.drop_front() <<
"Clause";
1834 dumpSourceRange(
SourceRange(
C->getLocStart(),
C->getLocEnd()));
1835 if (
C->isImplicit())
1836 OS <<
" <implicit>";
1837 for (
auto *S :
C->children())
1847 void ASTDumper::VisitExpr(
const Expr *Node) {
1852 ColorScope Color(*
this, ValueKindColor);
1866 ColorScope Color(*
this, ObjectKindColor);
1874 OS <<
" objcproperty";
1877 OS <<
" objcsubscript";
1880 OS <<
" vectorcomponent";
1911 void ASTDumper::VisitCastExpr(
const CastExpr *Node) {
1915 ColorScope Color(*
this, CastColor);
1922 void ASTDumper::VisitDeclRefExpr(
const DeclRefExpr *Node) {
1926 dumpBareDeclRef(Node->
getDecl());
1939 OS <<
"ADL) = '" << Node->
getName() <<
'\'';
1953 ColorScope Color(*
this, DeclKindNameColor);
1954 OS <<
" " << Node->
getDecl()->getDeclKindName() <<
"Decl";
1956 OS <<
"='" << *Node->
getDecl() <<
"'";
1959 OS <<
" isFreeIvar";
1962 void ASTDumper::VisitPredefinedExpr(
const PredefinedExpr *Node) {
1969 ColorScope Color(*
this, ValueColor);
1973 void ASTDumper::VisitIntegerLiteral(
const IntegerLiteral *Node) {
1977 ColorScope Color(*
this, ValueColor);
1978 OS <<
" " << Node->
getValue().toString(10, isSigned);
1983 ColorScope Color(*
this, ValueColor);
1987 void ASTDumper::VisitStringLiteral(
const StringLiteral *Str) {
1989 ColorScope Color(*
this, ValueColor);
1994 void ASTDumper::VisitInitListExpr(
const InitListExpr *ILE) {
1998 OS <<
"array filler";
2004 dumpBareDeclRef(Field);
2008 void ASTDumper::VisitUnaryOperator(
const UnaryOperator *Node) {
2010 OS <<
" " << (Node->
isPostfix() ?
"postfix" :
"prefix")
2014 void ASTDumper::VisitUnaryExprOrTypeTraitExpr(
2028 OS <<
" __builtin_omp_required_simd_align";
2035 void ASTDumper::VisitMemberExpr(
const MemberExpr *Node) {
2046 void ASTDumper::VisitBinaryOperator(
const BinaryOperator *Node) {
2051 void ASTDumper::VisitCompoundAssignOperator(
2055 <<
"' ComputeLHSTy=";
2057 OS <<
" ComputeResultTy=";
2061 void ASTDumper::VisitBlockExpr(
const BlockExpr *Node) {
2075 void ASTDumper::VisitAddrLabelExpr(
const AddrLabelExpr *Node) {
2096 OS <<
" " << (Node->
getValue() ?
"true" :
"false");
2099 void ASTDumper::VisitCXXThisExpr(
const CXXThisExpr *Node) {
2126 void ASTDumper::VisitCXXNewExpr(
const CXXNewExpr *Node) {
2140 void ASTDumper::VisitCXXDeleteExpr(
const CXXDeleteExpr *Node) {
2156 OS <<
" extended by ";
2157 dumpBareDeclRef(VD);
2163 for (
unsigned i = 0, e = Node->
getNumObjects(); i != e; ++i)
2164 dumpDeclRef(Node->
getObject(i),
"cleanup");
2167 void ASTDumper::dumpCXXTemporary(
const CXXTemporary *Temporary) {
2168 OS <<
"(CXXTemporary";
2169 dumpPointer(Temporary);
2173 void ASTDumper::VisitSizeOfPackExpr(
const SizeOfPackExpr *Node) {
2179 dumpTemplateArgument(A);
2201 OS <<
" super (instance)";
2205 OS <<
" super (class)";
2210 void ASTDumper::VisitObjCBoxedExpr(
const ObjCBoxedExpr *Node) {
2214 BoxingMethod->getSelector().print(OS);
2221 dumpDecl(CatchParam);
2226 void ASTDumper::VisitObjCEncodeExpr(
const ObjCEncodeExpr *Node) {
2247 OS <<
" Kind=MethodRef Getter=\"";
2253 OS <<
"\" Setter=\"";
2255 Setter->getSelector().print(OS);
2266 OS <<
" Messaging=";
2268 OS <<
"Getter&Setter";
2278 OS <<
" Kind=ArraySubscript GetterForArray=\"";
2280 OS <<
" Kind=DictionarySubscript GetterForDictionary=\"";
2287 OS <<
"\" SetterForArray=\"";
2289 OS <<
"\" SetterForDictionary=\"";
2298 OS <<
" " << (Node->
getValue() ?
"__objc_yes" :
"__objc_no");
2305 const char *ASTDumper::getCommandName(
unsigned CommandID) {
2307 return Traits->getCommandInfo(CommandID)->Name;
2311 return "<not a builtin command>";
2314 void ASTDumper::dumpFullComment(
const FullComment *C) {
2323 void ASTDumper::dumpComment(
const Comment *C) {
2326 ColorScope Color(*
this, NullColor);
2332 ColorScope Color(*
this, CommentColor);
2344 void ASTDumper::visitTextComment(
const TextComment *C) {
2345 OS <<
" Text=\"" << C->
getText() <<
"\"";
2349 OS <<
" Name=\"" << getCommandName(C->
getCommandID()) <<
"\"";
2352 OS <<
" RenderNormal";
2355 OS <<
" RenderBold";
2358 OS <<
" RenderMonospaced";
2361 OS <<
" RenderEmphasized";
2365 for (
unsigned i = 0, e = C->
getNumArgs(); i != e; ++i)
2366 OS <<
" Arg[" << i <<
"]=\"" << C->
getArgText(i) <<
"\"";
2373 for (
unsigned i = 0, e = C->
getNumAttrs(); i != e; ++i) {
2375 OS <<
" \"" << Attr.
Name <<
"=\"" << Attr.
Value <<
"\"";
2379 OS <<
" SelfClosing";
2387 OS <<
" Name=\"" << getCommandName(C->
getCommandID()) <<
"\"";
2388 for (
unsigned i = 0, e = C->
getNumArgs(); i != e; ++i)
2389 OS <<
" Arg[" << i <<
"]=\"" << C->
getArgText(i) <<
"\"";
2396 OS <<
" explicitly";
2398 OS <<
" implicitly";
2420 OS <<
" Position=<";
2421 for (
unsigned i = 0, e = C->
getDepth(); i != e; ++i) {
2431 OS <<
" Name=\"" << getCommandName(C->
getCommandID()) <<
"\""
2435 void ASTDumper::visitVerbatimBlockLineComment(
2437 OS <<
" Text=\"" << C->
getText() <<
"\"";
2441 OS <<
" Text=\"" << C->
getText() <<
"\"";
2450 llvm::errs() << msg <<
": ";
2455 ASTDumper Dumper(llvm::errs(),
nullptr,
nullptr);
2456 Dumper.dumpTypeAsChild(*
this);
2467 LLVM_DUMP_METHOD
void Decl::dump(raw_ostream &OS)
const {
2468 ASTDumper
P(OS, &getASTContext().getCommentCommandTraits(),
2469 &getASTContext().getSourceManager());
2473 LLVM_DUMP_METHOD
void Decl::dumpColor()
const {
2474 ASTDumper
P(llvm::errs(), &getASTContext().getCommentCommandTraits(),
2475 &getASTContext().getSourceManager(),
true);
2480 dumpLookups(llvm::errs());
2484 bool DumpDecls)
const {
2488 ASTContext &Ctx = cast<TranslationUnitDecl>(DC)->getASTContext();
2490 P.dumpLookups(
this, DumpDecls);
2498 dump(llvm::errs(), SM);
2502 ASTDumper
P(OS,
nullptr, &SM);
2506 LLVM_DUMP_METHOD
void Stmt::dump(raw_ostream &OS)
const {
2507 ASTDumper
P(OS,
nullptr,
nullptr);
2512 ASTDumper
P(llvm::errs(),
nullptr,
nullptr);
2516 LLVM_DUMP_METHOD
void Stmt::dumpColor()
const {
2517 ASTDumper
P(llvm::errs(),
nullptr,
nullptr,
true);
2526 dump(llvm::errs(),
nullptr,
nullptr);
2537 ASTDumper D(OS, Traits, SM);
2538 D.dumpFullComment(FC);
2543 ASTDumper D(llvm::errs(),
nullptr,
nullptr,
true);
2544 D.dumpFullComment(FC);
decl_iterator noload_decls_end() const
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
unsigned getNumElements() const
The receiver is the instance of the superclass object.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Defines the clang::ASTContext interface.
SourceLocation getEnd() const
Expr * getSizeExpr() const
const Type * Ty
The locally-unqualified type.
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
The receiver is an object instance.
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
unsigned getDepth() const
protocol_range protocols() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
A (possibly-)qualified type.
ArrayRef< Capture > captures() const
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
SourceRange getBracketsRange() const
unsigned getColumn() const
Return the presumed column number of this location.
ArrayRef< OMPClause * > clauses()
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
ObjCInterfaceDecl * getClassInterface()
bool isBitField() const
Determines whether this field is a bitfield.
QualType getType() const
Retrieves the type of the base class.
bool isElidable() const
Whether this construction is elidable.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
PropertyControl getPropertyImplementation() const
CXXMethodDecl * getSpecialization() const
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
bool isParameterPack() const
Returns whether this is a parameter pack.
FunctionType - C99 6.7.5.3 - Function Declarators.
bool isInvalid() const
Return true if this object is invalid or uninitialized.
const Expr * getInitExpr() const
bool isArgumentType() const
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
bool isGlobalDelete() const
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
CXXRecordDecl * getDecl() const
QualType getUnderlyingType() const
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
Defines the clang::Module class, which describes a module in the source code.
ObjCMethodDecl * getAtIndexMethodDecl() const
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Represents a C++11 auto or C++14 decltype(auto) type.
Represents an attribute applied to a statement.
std::string getAsString() const
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
const char * getCastKindName() const
QualType getPointeeType() const
The base class of the type hierarchy.
The parameter is covariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant and ...
Declaration of a variable template.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
const Expr * getInit() const
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
NamespaceDecl - Represent a C++ namespace.
Represents a call to a C++ constructor.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
bool isDecltypeAuto() const
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
A container of type source information.
unsigned getIndex() const
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
bool isSpelledAsLValue() const
Expr * getInClassInitializer() const
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not be...
NamedDecl *const * const_iterator
Iterates through the template parameters in this list.
IdentType getIdentType() const
const llvm::APInt & getSize() const
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
void * getAsOpaquePtr() const
bool hasExplicitTemplateArgs() const
const CXXBaseSpecifier *const * path_const_iterator
const TemplateArgumentListInfo & templateArgs() const
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
ArrayRef< TemplateArgument > getPartialArguments() const
Get.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Expr * getInit() const
Get the initializer.
bool capturesCXXThis() const
TLSKind getTLSKind() const
Represents an empty template argument, e.g., one that has not been deduced.
Extra information about a function prototype.
std::string getAsString() const
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
TemplateTypeParmDecl * getDecl() const
QualType getOriginalType() const
UnaryExprOrTypeTrait getKind() const
Stores a list of template parameters for a TemplateDecl and its derived classes.
Qualifiers getIndexTypeQualifiers() const
unsigned getValue() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
ParmVarDecl - Represents a parameter to a function.
Represents the result of substituting a type for a template type parameter.
void dump(const char *s) const
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
LabelStmt - Represents a label, which has a substatement.
Kind getPropertyImplementation() const
RecordDecl - Represents a struct/union/class.
std::string getFullModuleName() const
Retrieve the full name of this module, including the path from its top-level module.
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class. ...
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Provides common interface for the Decls that can be redeclared.
QualType getElementType() const
Represents a class template specialization, which refers to a class template with a given set of temp...
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
ObjCProtocolDecl * getProtocol() const
comments::CommandTraits & getCommentCommandTraits() const
StringLiteral * getMessage()
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
A vector component is an element or range of elements on a vector.
Expr * getSizeExpr() const
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
The results of name lookup within a DeclContext.
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
ArrayRef< QualType > getParamTypes() const
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
The parameter is contravariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant ...
protocol_iterator protocol_begin() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
bool isPure() const
Whether this virtual function is pure, i.e.
bool isTranslationUnit() const
unsigned size() const
Retrieve the number of template arguments in this template argument list.
Represents the result of substituting a set of types for a template type parameter pack...
IdentifierInfo & getAccessor() const
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Stmt * getBody() const override
Represents an access specifier followed by colon ':'.
unsigned getRegParm() const
Declaration of a function specialization at template class scope.
SourceRange getSourceRange() const LLVM_READONLY
Fetches the full source range of the argument.
Describes a module or submodule.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Expr * getUnderlyingExpr() const
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
const VarDecl * getCatchParamDecl() const
Represents Objective-C's @catch statement.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Describes an C or C++ initializer list.
Represents a C++ using-declaration.
Stmt * getBody() const override
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
TemplateArgument getArgumentPack() const
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
ObjCMethodDecl * getBoxingMethod() const
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
An lvalue ref-qualifier was provided (&).
bool isInline() const
Returns true if this is an inline namespace declaration.
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
A convenient class for passing around template argument information.
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
protocol_iterator protocol_end() const
QualType getReturnType() const
bool isSuperReceiver() const
UnresolvedUsingTypenameDecl * getDecl() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
path_iterator path_begin()
Represents a typeof (or typeof) expression (a GCC extension).
A builtin binary operation expression such as "x + y" or "x <= y".
Selector getSelector() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
std::string getNameAsString() const
getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kin...
QualType getDefaultArgument() const
Retrieve the default argument, if any.
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents an Objective-C protocol declaration.
Represents binding an expression to a temporary.
CXXTemporary * getTemporary()
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
unsigned getLine() const
Return the presumed line number of this location.
An ordinary object is located at an address in memory.
This represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
CleanupObject getObject(unsigned i) const
Represents a linkage specification.
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
ObjCMethodDecl * setAtIndexMethodDecl() const
detail::InMemoryDirectory::const_iterator I
is ARM Neon polynomial vector
PropertyAttributeKind getPropertyAttributes() const
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
bool isFromAST() const
Whether this type comes from an AST file.
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Represents an extended vector type where either the type or size is dependent.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
param_iterator param_begin()
static void dumpPreviousDeclImpl(raw_ostream &OS,...)
Represents the this expression in C++.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
FunctionDecl * getOperatorDelete() const
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
ExtInfo getExtInfo() const
llvm::APInt getValue() const
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
Represents a prototype with parameter type info, e.g.
Holds a QualType and a TypeSourceInfo* that came out of a declarator parsing.
unsigned getNumObjects() const
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
ArrayRef< NamedDecl * > getDeclsInPrototypeScope() const
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
SourceRange getRange() const
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
Represents an array type in C++ whose size is a value-dependent expression.
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
QualType getPointeeType() const
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
void outputString(raw_ostream &OS) const
static void dumpBasePath(raw_ostream &OS, const CastExpr *Node)
bool isDeletedAsWritten() const
decls_iterator decls_end() const
Declaration of a template type parameter.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
ObjCIvarDecl * getPropertyIvarDecl() const
double getValueAsApproximateDouble() const
getValueAsApproximateDouble - This returns the value as an inaccurate double.
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Expr * getBitWidth() const
ArrayRef< NamedDecl * > chain() const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Expr * getUnderlyingExpr() const
ObjCMethodDecl * getImplicitPropertyGetter() const
ArgKind getKind() const
Return the kind of stored template argument.
ExtProtoInfo getExtProtoInfo() const
ObjCSelectorExpr used for @selector in Objective-C.
Represents an expression that computes the length of a parameter pack.
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents the type decltype(expr) (C++11).
Selector getSelector() const
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
SourceLocation getAttributeLoc() const
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
StorageClass
Storage classes.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isInstanceMethod() const
Direct list-initialization (C++11)
Qualifiers Quals
The local qualifiers.
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
An expression that sends a message to the given Objective-C object or class.
Represents an unpacked "presumed" location which can be presented to the user.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
ArrayRef< ParmVarDecl * > parameters() const
Represents a GCC generic vector type.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
QualType getElementType() const
QualType getComputationLHSType() const
static QualType Desugar(ASTContext &Context, QualType QT, bool &ShouldAKA)
This template specialization was implicitly instantiated from a template.
DeclarationName getLookupName() const
UnresolvedSetImpl::iterator decls_iterator
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
ObjCCategoryDecl * getCategoryDecl() const
SourceRange getBracketsRange() const
QualType getComputationResultType() const
LabelDecl * getLabel() const
decls_iterator decls_begin() const
ArrayRef< ParmVarDecl * > parameters() const
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
bool doesThisDeclarationHaveABody() const
doesThisDeclarationHaveABody - Returns whether this specific declaration of the function has a body -...
StringRef getValue() const
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
is AltiVec 'vector Pixel'
This captures a statement into a function.
not a target-specific vector type
ExceptionSpecificationType Type
The kind of exception specification this is.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
const char * getFilename() const
Return the presumed filename of this location.
Encodes a location in the source.
const char * getNameStart() const
Return the beginning of the actual null-terminated string for this identifier.
unsigned getNumParams() const
getNumParams - Return the number of parameters this function must have based on its FunctionType...
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
all_lookups_iterator - An iterator that provides a view over the results of looking up every possible...
This represents '#pragma omp declare reduction ...' directive.
QualType getElementType() const
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Pseudo declaration for capturing expressions.
Represents a C++ temporary.
Interfaces are the core concept in Objective-C for object oriented design.
const ObjCInterfaceDecl * getClassInterface() const
FieldDecl * getAnyMember() const
This is a basic class for representing single OpenMP executable directive.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
decl_iterator noload_decls_begin() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
LabelDecl - Represents the declaration of a label.
VectorKind getVectorKind() const
Represents a dependent using declaration which was not marked with typename.
TypeAliasDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
bool getSynthesize() const
No ref-qualifier was provided.
C-style initialization with assignment.
ArrayRef< ParmVarDecl * > parameters() const
all_lookups_iterator noload_lookups_end() const
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
This file defines OpenMP nodes for declarative directives.
all_lookups_iterator noload_lookups_begin() const
Iterators over all possible lookups within this context that are currently loaded; don't attempt to r...
ObjCCategoryDecl - Represents a category declaration.
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
const ObjCInterfaceDecl * getClassInterface() const
NamedDecl * getPack() const
Retrieve the parameter pack.
decl_iterator decl_begin()
ObjCProtocolExpr used for protocol expression in Objective-C.
SplitQualType getSplitDesugaredType() const
is AltiVec 'vector bool ...'
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Represents one property declaration in an Objective-C interface.
TypedefNameDecl * getDecl() const
QualType getReturnType() const
SourceLocation getBegin() const
This template specialization was instantiated from a template due to an explicit instantiation defini...
This template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
Represents a C++11 static_assert declaration.
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
An rvalue ref-qualifier was provided (&&).
ObjCBoxedExpr - used for generalized expression boxing.
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
const BlockDecl * getBlockDecl() const
QualType getType() const
Return the type wrapped by this type source info.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
The injected class name of a C++ class template or class template partial specialization.
QualType getPointeeType() const
Represents a pack expansion of types.
CompoundAssignOperator - For compound assignments (e.g.
bool isPartiallySubstituted() const
Determine whether this represents a partially-substituted sizeof...
static const char * getStorageClassSpecifierString(StorageClass SC)
getStorageClassSpecifierString - Return the string used to specify the storage class SC...
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast", "reinterpret_cast", or "const_cast".
const char * getTypeClassName() const
Expr * getSizeExpr() const
AddrLabelExpr - The GNU address of label extension, representing &&label.
attr::Kind getKind() const
ast_type_traits::DynTypedNode Node
TLS with a dynamic initializer.
Represents a template argument.
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons...
QualType getAsType() const
Retrieve the type for a type template argument.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
Print this nested name specifier to the given output stream.
bool isImplicitProperty() const
StringRef getOpcodeStr() const
ObjCCategoryImplDecl * getImplementation() const
not evaluated yet, for special member function
[C99 6.4.2.2] - A predefined identifier such as func.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
The base class of all kinds of template declarations (e.g., class, function, etc.).
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
The template argument is a pack expansion of a template name that was provided for a template templat...
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user...
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
This template specialization was instantiated from a template due to an explicit instantiation declar...
bool isParameterPack() const
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Represents a dependent using declaration which was marked with typename.
DeclarationName - The name of a declaration.
Represents the declaration of an Objective-C type parameter.
Selector getSelector() const
EnumDecl - Represents an enum.
detail::InMemoryDirectory::const_iterator E
A pointer to member type per C++ 8.3.3 - Pointers to members.
QualType getModifiedType() const
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
Represents a pointer to an Objective C object.
StringRef getName() const
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
ObjCMethodDecl * getGetterMethodDecl() const
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Complex values, per C99 6.2.5p11.
Location wrapper for a TemplateArgument.
FunctionDecl * getOperatorNew() const
const T * getAs() const
Member-template getAs<specific type>'.
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
Represents a C++ base or member initializer.
static StringRef getIdentTypeName(IdentType IT)
This template specialization was declared or defined by an explicit specialization (C++ [temp...
void dump(raw_ostream &OS) const
Debugging aid that dumps the template name.
ObjCMethodDecl * getSetterMethodDecl() const
ObjCEncodeExpr, used for @encode in Objective-C.
ObjCProtocolList::iterator protocol_iterator
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
bool hasBody() const override
Determine whether this method has a body.
DeclGroupRef::const_iterator const_decl_iterator
Base for LValueReferenceType and RValueReferenceType.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
The template argument is a type.
protocol_range protocols() const
ObjCImplementationDecl * getImplementation() const
The template argument is actually a parameter pack.
LabelDecl * getLabel() const
Represents a base class of a C++ class.
ObjCPropertyDecl * getExplicitProperty() const
A bitfield object is a bitfield on a C or C++ record.
bool isAnyMemberInitializer() const
QualType getPointeeType() const
ObjCIvarRefExpr - A reference to an ObjC instance variable.
SourceManager & getSourceManager()
GotoStmt - This represents a direct goto.
ArrayRef< const Attr * > getAttrs() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
A template argument list.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
const Type * getClass() const
ObjCPropertyDecl * getPropertyDecl() const
AccessControl getAccessControl() const
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
An attributed type is a type to which a type attribute has been applied.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
Call-style initialization (C++98)
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
Represents a C++ struct/union/class.
bool hasQualifiers() const
Return true if the set contains any qualifiers.
The template argument is a template name that was provided for a template template parameter...
QualType getEncodedType() const
CXXCatchStmt - This represents a C++ catch block.
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
ObjCIvarDecl - Represents an ObjC instance variable.
ArraySizeModifier getSizeModifier() const
bool isInline() const
Whether this variable is (C++1z) inline.
Declaration of a class template.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
static void dumpPreviousDecl(raw_ostream &OS, const Decl *D)
Dump the previous declaration in the redeclaration chain for a declaration, if any.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
pack_iterator pack_end() const
Iterator referencing one past the last argument of a template argument pack.
StringLiteral - This represents a string literal expression, e.g.
DeclarationName getName() const
Gets the name looked up.
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
TLS with a known-constant initializer.
ObjCInterfaceDecl * getSuperClass() const
TagDecl * getDecl() const
Abstract class common to all of the C++ "named"/"keyword" casts.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
VarDecl * getExceptionDecl() const
A reference to a declared variable, function, enum, etc.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
QualType getElementType() const
QualType getElementType() const
CXXCtorInitializer *const * init_const_iterator
Iterates through the member/base initializer list.
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
bool isArraySubscriptRefExpr() const
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
static StringRef getNameForCallConv(CallingConv CC)
An l-value expression is a reference to an object with independent storage.
StringRef getKindName() const
A trivial tuple used to represent a source range.
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to...
NamedDecl - This represents a decl with a name.
A boolean literal, per ([C++ lex.bool] Boolean literals).
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a C++ namespace alias.
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
Represents C++ using-directive.
Represents a #pragma detect_mismatch line.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
The receiver is a superclass.
const char * getName() const
A simple visitor class that helps create declaration visitors.
const TemplateArgument & getArgument() const
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
This represents '#pragma omp threadprivate ...' directive.
TemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon, QualType Aliased)
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Represents the canonical version of C arrays with a specified constant size.
This class handles loading and caching of source files into memory.
The parameter is invariant: must match exactly.
ExceptionSpecInfo ExceptionSpec
Defines enum values for all the target-independent builtin functions.
Declaration of a template function.
ObjCMethodDecl * getImplicitPropertySetter() const
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
Attr - This represents one attribute.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
ObjCCompatibleAliasDecl - Represents alias of a class.
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool isHidden() const
Determine whether this declaration is hidden from name lookup.
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
const ObjCInterfaceDecl * getSuperClass() const
const StringLiteral * getAsmString() const
QualType getArgumentType() const
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.