28 #include "llvm/Support/raw_ostream.h"
29 using namespace clang;
30 using namespace clang::comments;
40 struct TerminalColor {
41 raw_ostream::Colors Color;
56 static const TerminalColor DeclKindNameColor = { raw_ostream::GREEN,
true };
58 static const TerminalColor AttrColor = { raw_ostream::BLUE,
true };
60 static const TerminalColor StmtColor = { raw_ostream::MAGENTA,
true };
62 static const TerminalColor CommentColor = { raw_ostream::BLUE,
false };
65 static const TerminalColor TypeColor = { raw_ostream::GREEN,
false };
68 static const TerminalColor AddressColor = { raw_ostream::YELLOW,
false };
70 static const TerminalColor LocationColor = { raw_ostream::YELLOW,
false };
73 static const TerminalColor ValueKindColor = { raw_ostream::CYAN,
false };
75 static const TerminalColor ObjectKindColor = { raw_ostream::CYAN,
false };
78 static const TerminalColor NullColor = { raw_ostream::BLUE,
false };
81 static const TerminalColor UndeserializedColor = { raw_ostream::GREEN,
true };
84 static const TerminalColor CastColor = { raw_ostream::RED,
false };
87 static const TerminalColor ValueColor = { raw_ostream::CYAN,
true };
89 static const TerminalColor DeclNameColor = { raw_ostream::CYAN,
true };
92 static const TerminalColor IndentColor = { raw_ostream::BLUE,
false };
115 const char *LastLocFilename;
116 unsigned LastLocLine;
124 template<
typename Fn>
void dumpChild(Fn doDumpChild) {
130 while (!Pending.empty()) {
131 Pending.back()(
true);
141 auto dumpWithIndent = [
this, doDumpChild, OrigFC](
bool isLastChild) {
156 ColorScope Color(*
this, IndentColor);
157 OS << Prefix << (isLastChild ?
'`' :
'|') <<
'-';
158 this->Prefix.push_back(isLastChild ?
' ' :
'|');
159 this->Prefix.push_back(
' ');
163 unsigned Depth = Pending.size();
170 while (Depth < Pending.size()) {
171 Pending.back()(
true);
172 this->Pending.pop_back();
176 this->Prefix.resize(Prefix.size() - 2);
180 Pending.push_back(std::move(dumpWithIndent));
182 Pending.back()(
false);
183 Pending.back() = std::move(dumpWithIndent);
191 ColorScope(ASTDumper &Dumper, TerminalColor Color)
193 if (Dumper.ShowColors)
194 Dumper.OS.changeColor(Color.Color, Color.Bold);
197 if (Dumper.ShowColors)
198 Dumper.OS.resetColor();
205 : OS(OS), Traits(Traits), SM(SM), TopLevel(
true), FirstChild(
true),
206 LastLocFilename(
""), LastLocLine(~0U), FC(nullptr),
207 ShowColors(SM && SM->getDiagnostics().getShowColors()) { }
211 : OS(OS), Traits(Traits), SM(SM), TopLevel(
true), FirstChild(
true),
212 LastLocFilename(
""), LastLocLine(~0U),
213 ShowColors(ShowColors) { }
215 void dumpDecl(
const Decl *D);
216 void dumpStmt(
const Stmt *
S);
220 void dumpPointer(
const void *Ptr);
226 void dumpTypeAsChild(
const Type *T);
227 void dumpBareDeclRef(
const Decl *
Node);
228 void dumpDeclRef(
const Decl *
Node,
const char *Label =
nullptr);
232 void dumpLookups(
const DeclContext *DC,
bool DumpDecls);
233 void dumpAttr(
const Attr *A);
263 OS <<
" written as lvalue reference";
264 VisitReferenceType(T);
270 void VisitArrayType(
const ArrayType *T) {
295 void VisitDependentSizedExtVectorType(
316 if (EI.getNoReturn()) OS <<
" noreturn";
317 if (EI.getProducesResult()) OS <<
" produces_result";
318 if (EI.getHasRegParm()) OS <<
" regparm " << EI.
getRegParm();
324 if (EPI.HasTrailingReturn) OS <<
" trailing_return";
325 if (T->
isConst()) OS <<
" const";
328 switch (EPI.RefQualifier) {
335 VisitFunctionType(T);
339 dumpChild([=] { OS <<
"..."; });
356 OS <<
" underlying_type";
361 void VisitTagType(
const TagType *T) {
376 void VisitSubstTemplateTypeParmPackType(
381 void VisitAutoType(
const AutoType *T) {
387 if (T->isTypeAlias()) OS <<
" alias";
388 OS <<
" "; T->getTemplateName().dump(OS);
390 dumpTemplateArgument(Arg);
391 if (T->isTypeAlias())
392 dumpTypeAsChild(T->getAliasedType());
420 void VisitEnumDecl(
const EnumDecl *D);
426 void VisitVarDecl(
const VarDecl *D);
438 template<
typename SpecializationDecl>
439 void VisitTemplateDeclSpecialization(
const SpecializationDecl *D,
440 bool DumpExplicitInst,
442 template<
typename TemplateDecl>
443 void VisitTemplateDecl(
const TemplateDecl *D,
bool DumpExplicitInst);
446 void VisitClassTemplateSpecializationDecl(
448 void VisitClassTemplatePartialSpecializationDecl(
450 void VisitClassScopeFunctionSpecializationDecl(
454 void VisitVarTemplateSpecializationDecl(
456 void VisitVarTemplatePartialSpecializationDecl(
543 const char *getCommandName(
unsigned CommandID);
566 void ASTDumper::dumpPointer(
const void *Ptr) {
567 ColorScope Color(*
this, AddressColor);
575 ColorScope Color(*
this, LocationColor);
583 OS <<
"<invalid sloc>";
587 if (strcmp(PLoc.
getFilename(), LastLocFilename) != 0) {
592 }
else if (PLoc.
getLine() != LastLocLine) {
593 OS <<
"line" <<
':' << PLoc.
getLine()
619 ColorScope Color(*
this, TypeColor);
624 if (Desugar && !T.
isNull()) {
627 if (T_split != D_split)
632 void ASTDumper::dumpType(
QualType T) {
637 void ASTDumper::dumpTypeAsChild(
QualType T) {
640 return dumpTypeAsChild(SQT.
Ty);
646 dumpBareType(T,
false);
652 void ASTDumper::dumpTypeAsChild(
const Type *T) {
655 ColorScope Color(*
this, NullColor);
659 if (
const LocInfoType *LIT = llvm::dyn_cast<LocInfoType>(T)) {
661 ColorScope Color(*
this, TypeColor);
662 OS <<
"LocInfo Type";
665 dumpTypeAsChild(LIT->getTypeSourceInfo()->getType());
670 ColorScope Color(*
this, TypeColor);
675 dumpBareType(
QualType(T, 0),
false);
679 if (SingleStepDesugar !=
QualType(T, 0))
684 OS <<
" instantiation_dependent";
686 OS <<
" variably_modified";
688 OS <<
" contains_unexpanded_pack";
694 if (SingleStepDesugar !=
QualType(T, 0))
695 dumpTypeAsChild(SingleStepDesugar);
699 void ASTDumper::dumpBareDeclRef(
const Decl *D) {
701 ColorScope Color(*
this, DeclKindNameColor);
706 if (
const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
707 ColorScope Color(*
this, DeclNameColor);
708 OS <<
" '" << ND->getDeclName() <<
'\'';
711 if (
const ValueDecl *VD = dyn_cast<ValueDecl>(D))
712 dumpType(VD->getType());
715 void ASTDumper::dumpDeclRef(
const Decl *D,
const char *Label) {
726 void ASTDumper::dumpName(
const NamedDecl *ND) {
728 ColorScope Color(*
this, DeclNameColor);
741 void ASTDumper::dumpDeclContext(
const DeclContext *DC) {
750 ColorScope Color(*
this, UndeserializedColor);
751 OS <<
"<undeserialized declarations>";
756 void ASTDumper::dumpLookups(
const DeclContext *DC,
bool DumpDecls) {
758 OS <<
"StoredDeclsMap ";
759 dumpBareDeclRef(cast<Decl>(DC));
764 dumpPointer(cast<Decl>(Primary));
776 OS <<
"DeclarationName ";
778 ColorScope Color(*
this, DeclNameColor);
779 OS <<
'\'' << Name <<
'\'';
785 dumpBareDeclRef(*RI);
787 if ((*RI)->isHidden())
793 std::function<void(Decl *)> DumpWithPrev = [&](
Decl *D) {
805 if (HasUndeserializedLookups) {
807 ColorScope Color(*
this, UndeserializedColor);
808 OS <<
"<undeserialized lookups>";
814 void ASTDumper::dumpAttr(
const Attr *A) {
817 ColorScope Color(*
this, AttrColor);
820 #define ATTR(X) case attr::X: OS << #X; break;
821 #include "clang/Basic/AttrList.inc"
823 llvm_unreachable(
"unexpected attribute kind");
833 #include "clang/AST/AttrDump.inc"
843 OS <<
" first " << First;
850 OS <<
" prev " << Prev;
857 #define DECL(DERIVED, BASE) \
858 case Decl::DERIVED: \
859 return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
860 #define ABSTRACT_DECL(DECL)
861 #include "clang/AST/DeclNodes.inc"
863 llvm_unreachable(
"Decl that isn't part of DeclNodes.inc!");
888 OS <<
"CXXCtorInitializer";
897 llvm_unreachable(
"Unknown initializer type");
912 void ASTDumper::dumpTemplateArgumentListInfo(
914 for (
unsigned i = 0, e = TALI.
size(); i < e; ++i)
915 dumpTemplateArgumentLoc(TALI[i]);
923 for (
unsigned i = 0, e = TAL.
size(); i < e; ++i)
924 dumpTemplateArgument(TAL[i]);
929 OS <<
"TemplateArgument";
956 OS <<
" template expansion";
967 dumpTemplateArgument(*I);
980 for (
auto typeParam : *typeParams) {
989 void ASTDumper::dumpDecl(
const Decl *D) {
992 ColorScope Color(*
this, NullColor);
998 ColorScope Color(*
this, DeclKindNameColor);
1009 OS <<
" in " << M->getFullModuleName();
1011 OS <<
" in (local) " << M->getFullModuleName();
1012 if (
auto *ND = dyn_cast<NamedDecl>(D))
1014 const_cast<NamedDecl *>(ND)))
1015 dumpChild([=] { OS <<
"also in " << M->getFullModuleName(); });
1016 if (
const NamedDecl *ND = dyn_cast<NamedDecl>(D))
1024 OS <<
" referenced";
1027 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
1028 if (FD->isConstexpr())
1043 if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D) &&
1044 hasNodes(dyn_cast<DeclContext>(D)))
1045 dumpDeclContext(cast<DeclContext>(D));
1049 void ASTDumper::VisitLabelDecl(
const LabelDecl *D) {
1053 void ASTDumper::VisitTypedefDecl(
const TypedefDecl *D) {
1057 OS <<
" __module_private__";
1061 void ASTDumper::VisitEnumDecl(
const EnumDecl *D) {
1070 OS <<
" __module_private__";
1075 void ASTDumper::VisitRecordDecl(
const RecordDecl *D) {
1079 OS <<
" __module_private__";
1081 OS <<
" definition";
1095 for (
auto *Child : D->
chain())
1099 void ASTDumper::VisitFunctionDecl(
const FunctionDecl *D) {
1111 OS <<
" __module_private__";
1133 dumpTemplateArgumentList(*FTSI->TemplateArguments);
1141 dumpChild([=] { OS <<
"<<NULL params x " << D->
getNumParams() <<
">>"; });
1152 dumpCXXCtorInitializer(*I);
1158 void ASTDumper::VisitFieldDecl(
const FieldDecl *D) {
1164 OS <<
" __module_private__";
1172 void ASTDumper::VisitVarDecl(
const VarDecl *D) {
1184 OS <<
" __module_private__";
1201 void ASTDumper::VisitImportDecl(
const ImportDecl *D) {
1209 void ASTDumper::VisitNamespaceDecl(
const NamespaceDecl *D) {
1227 void ASTDumper::VisitTypeAliasDecl(
const TypeAliasDecl *D) {
1239 void ASTDumper::VisitCXXRecordDecl(
const CXXRecordDecl *D) {
1244 for (
const auto &I : D->
bases()) {
1248 dumpAccessSpecifier(I.getAccessSpecifier());
1249 dumpType(I.getType());
1250 if (I.isPackExpansion())
1261 template<
typename SpecializationDecl>
1262 void ASTDumper::VisitTemplateDeclSpecialization(
const SpecializationDecl *D,
1263 bool DumpExplicitInst,
1265 bool DumpedAny =
false;
1266 for (
auto *RedeclWithBadType : D->redecls()) {
1270 auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
1274 assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
1275 "expected an injected-class-name");
1279 switch (Redecl->getTemplateSpecializationKind()) {
1282 if (!DumpExplicitInst)
1288 dumpDeclRef(Redecl);
1303 template<
typename TemplateDecl>
1304 void ASTDumper::VisitTemplateDecl(
const TemplateDecl *D,
1305 bool DumpExplicitInst) {
1311 for (
auto *Child : D->specializations())
1312 VisitTemplateDeclSpecialization(Child, DumpExplicitInst,
1320 VisitTemplateDecl(D,
true);
1324 VisitTemplateDecl(D,
false);
1327 void ASTDumper::VisitClassTemplateSpecializationDecl(
1329 VisitCXXRecordDecl(D);
1333 void ASTDumper::VisitClassTemplatePartialSpecializationDecl(
1335 VisitClassTemplateSpecializationDecl(D);
1339 void ASTDumper::VisitClassScopeFunctionSpecializationDecl(
1347 VisitTemplateDecl(D,
false);
1355 void ASTDumper::VisitVarTemplateSpecializationDecl(
1361 void ASTDumper::VisitVarTemplatePartialSpecializationDecl(
1364 VisitVarTemplateSpecializationDecl(D);
1388 void ASTDumper::VisitTemplateTemplateParmDecl(
1398 void ASTDumper::VisitUsingDecl(
const UsingDecl *D) {
1405 void ASTDumper::VisitUnresolvedUsingTypenameDecl(
1425 dumpTypeAsChild(TD->getTypeForDecl());
1440 void ASTDumper::VisitFriendDecl(
const FriendDecl *D) {
1442 dumpType(T->getType());
1451 void ASTDumper::VisitObjCIvarDecl(
const ObjCIvarDecl *D) {
1455 OS <<
" synthesize";
1494 dumpChild([=] { OS <<
"..."; });
1511 OS <<
" contravariant";
1561 dumpCXXCtorInitializer(*I);
1599 OS <<
" unsafe_unretained";
1610 OS <<
" synthesize";
1617 void ASTDumper::VisitBlockDecl(
const BlockDecl *D) {
1618 for (
auto I : D->
params())
1622 dumpChild([=]{ OS <<
"..."; });
1625 dumpChild([=]{ OS <<
"capture this"; });
1627 for (
const auto &I : D->
captures()) {
1634 if (I.getVariable()) {
1636 dumpBareDeclRef(I.getVariable());
1638 if (I.hasCopyExpr())
1639 dumpStmt(I.getCopyExpr());
1649 void ASTDumper::dumpStmt(
const Stmt *
S) {
1652 ColorScope Color(*
this, NullColor);
1657 if (
const DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
1664 for (
const Stmt *SubStmt : S->children())
1669 void ASTDumper::VisitStmt(
const Stmt *
Node) {
1671 ColorScope Color(*
this, StmtColor);
1672 OS << Node->getStmtClassName();
1675 dumpSourceRange(Node->getSourceRange());
1678 void ASTDumper::VisitDeclStmt(
const DeclStmt *Node) {
1686 void ASTDumper::VisitAttributedStmt(
const AttributedStmt *Node) {
1694 void ASTDumper::VisitLabelStmt(
const LabelStmt *Node) {
1696 OS <<
" '" << Node->
getName() <<
"'";
1699 void ASTDumper::VisitGotoStmt(
const GotoStmt *Node) {
1705 void ASTDumper::VisitCXXCatchStmt(
const CXXCatchStmt *Node) {
1714 void ASTDumper::VisitExpr(
const Expr *Node) {
1719 ColorScope Color(*
this, ValueKindColor);
1733 ColorScope Color(*
this, ObjectKindColor);
1741 OS <<
" objcproperty";
1744 OS <<
" objcsubscript";
1747 OS <<
" vectorcomponent";
1778 void ASTDumper::VisitCastExpr(
const CastExpr *Node) {
1782 ColorScope Color(*
this, CastColor);
1789 void ASTDumper::VisitDeclRefExpr(
const DeclRefExpr *Node) {
1793 dumpBareDeclRef(Node->
getDecl());
1806 OS <<
"ADL) = '" << Node->
getName() <<
'\'';
1820 ColorScope Color(*
this, DeclKindNameColor);
1823 OS <<
"='" << *Node->
getDecl() <<
"'";
1826 OS <<
" isFreeIvar";
1829 void ASTDumper::VisitPredefinedExpr(
const PredefinedExpr *Node) {
1836 ColorScope Color(*
this, ValueColor);
1840 void ASTDumper::VisitIntegerLiteral(
const IntegerLiteral *Node) {
1844 ColorScope Color(*
this, ValueColor);
1845 OS <<
" " << Node->
getValue().toString(10, isSigned);
1850 ColorScope Color(*
this, ValueColor);
1854 void ASTDumper::VisitStringLiteral(
const StringLiteral *Str) {
1856 ColorScope Color(*
this, ValueColor);
1861 void ASTDumper::VisitInitListExpr(
const InitListExpr *ILE) {
1865 OS <<
"array filler";
1871 dumpBareDeclRef(Field);
1875 void ASTDumper::VisitUnaryOperator(
const UnaryOperator *Node) {
1877 OS <<
" " << (Node->
isPostfix() ?
"postfix" :
"prefix")
1881 void ASTDumper::VisitUnaryExprOrTypeTraitExpr(
1895 OS <<
" __builtin_omp_required_simd_align";
1902 void ASTDumper::VisitMemberExpr(
const MemberExpr *Node) {
1913 void ASTDumper::VisitBinaryOperator(
const BinaryOperator *Node) {
1918 void ASTDumper::VisitCompoundAssignOperator(
1922 <<
"' ComputeLHSTy=";
1924 OS <<
" ComputeResultTy=";
1928 void ASTDumper::VisitBlockExpr(
const BlockExpr *Node) {
1942 void ASTDumper::VisitAddrLabelExpr(
const AddrLabelExpr *Node) {
1963 OS <<
" " << (Node->
getValue() ?
"true" :
"false");
1966 void ASTDumper::VisitCXXThisExpr(
const CXXThisExpr *Node) {
1993 void ASTDumper::VisitCXXNewExpr(
const CXXNewExpr *Node) {
2007 void ASTDumper::VisitCXXDeleteExpr(
const CXXDeleteExpr *Node) {
2023 OS <<
" extended by ";
2024 dumpBareDeclRef(VD);
2030 for (
unsigned i = 0, e = Node->
getNumObjects(); i != e; ++i)
2031 dumpDeclRef(Node->
getObject(i),
"cleanup");
2034 void ASTDumper::dumpCXXTemporary(
const CXXTemporary *Temporary) {
2035 OS <<
"(CXXTemporary";
2036 dumpPointer(Temporary);
2040 void ASTDumper::VisitSizeOfPackExpr(
const SizeOfPackExpr *Node) {
2046 dumpTemplateArgument(A);
2068 OS <<
" super (instance)";
2072 OS <<
" super (class)";
2077 void ASTDumper::VisitObjCBoxedExpr(
const ObjCBoxedExpr *Node) {
2086 dumpDecl(CatchParam);
2091 void ASTDumper::VisitObjCEncodeExpr(
const ObjCEncodeExpr *Node) {
2112 OS <<
" Kind=MethodRef Getter=\"";
2118 OS <<
"\" Setter=\"";
2120 Setter->getSelector().print(OS);
2131 OS <<
" Messaging=";
2133 OS <<
"Getter&Setter";
2143 OS <<
" Kind=ArraySubscript GetterForArray=\"";
2145 OS <<
" Kind=DictionarySubscript GetterForDictionary=\"";
2152 OS <<
"\" SetterForArray=\"";
2154 OS <<
"\" SetterForDictionary=\"";
2163 OS <<
" " << (Node->
getValue() ?
"__objc_yes" :
"__objc_no");
2170 const char *ASTDumper::getCommandName(
unsigned CommandID) {
2172 return Traits->getCommandInfo(CommandID)->Name;
2176 return "<not a builtin command>";
2179 void ASTDumper::dumpFullComment(
const FullComment *
C) {
2188 void ASTDumper::dumpComment(
const Comment *C) {
2191 ColorScope Color(*
this, NullColor);
2197 ColorScope Color(*
this, CommentColor);
2209 void ASTDumper::visitTextComment(
const TextComment *C) {
2210 OS <<
" Text=\"" << C->
getText() <<
"\"";
2214 OS <<
" Name=\"" << getCommandName(C->
getCommandID()) <<
"\"";
2217 OS <<
" RenderNormal";
2220 OS <<
" RenderBold";
2223 OS <<
" RenderMonospaced";
2226 OS <<
" RenderEmphasized";
2230 for (
unsigned i = 0, e = C->
getNumArgs(); i != e; ++i)
2231 OS <<
" Arg[" << i <<
"]=\"" << C->
getArgText(i) <<
"\"";
2238 for (
unsigned i = 0, e = C->
getNumAttrs(); i != e; ++i) {
2240 OS <<
" \"" << Attr.
Name <<
"=\"" << Attr.
Value <<
"\"";
2244 OS <<
" SelfClosing";
2252 OS <<
" Name=\"" << getCommandName(C->
getCommandID()) <<
"\"";
2253 for (
unsigned i = 0, e = C->
getNumArgs(); i != e; ++i)
2254 OS <<
" Arg[" << i <<
"]=\"" << C->
getArgText(i) <<
"\"";
2261 OS <<
" explicitly";
2263 OS <<
" implicitly";
2285 OS <<
" Position=<";
2286 for (
unsigned i = 0, e = C->
getDepth(); i != e; ++i) {
2296 OS <<
" Name=\"" << getCommandName(C->
getCommandID()) <<
"\""
2300 void ASTDumper::visitVerbatimBlockLineComment(
2302 OS <<
" Text=\"" << C->
getText() <<
"\"";
2306 OS <<
" Text=\"" << C->
getText() <<
"\"";
2315 llvm::errs() << msg <<
": ";
2320 ASTDumper Dumper(llvm::errs(),
nullptr,
nullptr);
2321 Dumper.dumpTypeAsChild(*
this);
2333 ASTDumper
P(OS, &getASTContext().getCommentCommandTraits(),
2334 &getASTContext().getSourceManager());
2339 ASTDumper
P(llvm::errs(), &getASTContext().getCommentCommandTraits(),
2340 &getASTContext().getSourceManager(),
true);
2345 dumpLookups(llvm::errs());
2349 bool DumpDecls)
const {
2353 ASTContext &Ctx = cast<TranslationUnitDecl>(DC)->getASTContext();
2355 P.dumpLookups(
this, DumpDecls);
2363 dump(llvm::errs(), SM);
2367 ASTDumper
P(OS,
nullptr, &SM);
2371 LLVM_DUMP_METHOD
void Stmt::dump(raw_ostream &OS)
const {
2372 ASTDumper
P(OS,
nullptr,
nullptr);
2377 ASTDumper
P(llvm::errs(),
nullptr,
nullptr);
2381 LLVM_DUMP_METHOD
void Stmt::dumpColor()
const {
2382 ASTDumper
P(llvm::errs(),
nullptr,
nullptr,
true);
2391 dump(llvm::errs(),
nullptr,
nullptr);
2402 ASTDumper D(OS, Traits, SM);
2403 D.dumpFullComment(FC);
2408 ASTDumper D(llvm::errs(),
nullptr,
nullptr,
true);
2409 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.
param_const_iterator param_begin() const
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
ParmVarDecl *const * param_const_iterator
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.
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.
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.
Decl - This represents one declaration (or definition), e.g.
ObjCMethodDecl * getAtIndexMethodDecl() const
chain_range chain() 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.
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
std::string getAsString() const
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
const char * getCastKindName() const
TemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon, QualType Aliased)
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 ...
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
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
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
Represents an empty template argument, e.g., one that has not been deduced.
Extra information about a function prototype.
AccessSpecifier getAccess() const
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...
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.
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. ...
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.
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
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
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
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.
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
TemplateArgument getArgumentPack() const
ObjCMethodDecl * getBoxingMethod() const
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
An lvalue ref-qualifier was provided (&).
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
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.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
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.
Module * getLocalOwningModule() const
Get the local owning module, if known.
An ordinary object is located at an address in memory.
Represents an ObjC class declaration.
CleanupObject getObject(unsigned i) const
Represents a linkage specification.
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...
const ParmVarDecl *const * param_const_iterator
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
ArrayRef< Module * > getModulesWithMergedDefinition(NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
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
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.
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
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
DeclContext * getDeclContext()
ObjCSelectorExpr used for @selector in Objective-C.
const char * getDeclKindName() const
Represents an expression that computes the length of a parameter pack.
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.
Module * getImportedOwningModule() const
Get the imported owning module, if this decl is from an imported (non-local) module.
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.
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
const clang::PrintingPolicy & getPrintingPolicy() const
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
param_const_iterator param_end() const
QualType getComputationResultType() const
LabelDecl * getLabel() const
decls_iterator decls_begin() 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 -...
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
is AltiVec 'vector Pixel'
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...
QualType getElementType() const
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Represents a C++ temporary.
Interfaces are the core concept in Objective-C for object oriented design.
const ObjCInterfaceDecl * getClassInterface() const
FieldDecl * getAnyMember() const
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)"...
ASTContext & getASTContext() const LLVM_READONLY
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.
all_lookups_iterator noload_lookups_end() const
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
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.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
The template argument is a pack expansion of a template name that was provided for a template templat...
bool isInvalidDecl() const
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.
bool isUsed(bool CheckUsedAttr=true) const
Whether this declaration was used, meaning that a definition is required.
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
attr_iterator attr_end() const
param_iterator param_end()
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
Represents a pointer to an Objective C object.
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
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
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
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.
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.
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.
attr_iterator attr_begin() const
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.
SourceLocation getLocation() const
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.
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.
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.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
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.
AttrVec::const_iterator attr_iterator
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.