25 #include "llvm/ADT/SmallString.h"
26 #include "llvm/Support/Format.h"
27 using namespace clang;
34 class StmtPrinter :
public StmtVisitor<StmtPrinter> {
43 unsigned Indentation = 0)
44 : OS(os), IndentLevel(Indentation), Helper(helper), Policy(Policy) {}
46 void PrintStmt(
Stmt *
S) {
47 PrintStmt(S, Policy.Indentation);
50 void PrintStmt(
Stmt *
S,
int SubIndent) {
51 IndentLevel += SubIndent;
52 if (S && isa<Expr>(S)) {
60 Indent() <<
"<<<NULL STATEMENT>>>\n";
62 IndentLevel -= SubIndent;
66 void PrintRawDecl(
Decl *D);
67 void PrintRawDeclStmt(
const DeclStmt *S);
68 void PrintRawIfStmt(
IfStmt *If);
75 void PrintExpr(
Expr *E) {
82 raw_ostream &
Indent(
int Delta = 0) {
83 for (
int i = 0, e = IndentLevel+Delta; i < e; ++i)
89 if (Helper && Helper->handledStmt(S,OS))
95 Indent() <<
"<<unknown stmt type>>\n";
97 void VisitExpr(
Expr *
Node) LLVM_ATTRIBUTE_UNUSED {
98 OS <<
"<<unknown expr type>>";
102 #define ABSTRACT_STMT(CLASS)
103 #define STMT(CLASS, PARENT) \
104 void Visit##CLASS(CLASS *Node);
105 #include "clang/AST/StmtNodes.inc"
117 for (
auto *I : Node->
body())
123 void StmtPrinter::PrintRawDecl(
Decl *D) {
124 D->
print(OS, Policy, IndentLevel);
127 void StmtPrinter::PrintRawDeclStmt(
const DeclStmt *S) {
138 PrintRawDeclStmt(Node);
144 PrintRawCompoundStmt(Node);
150 PrintExpr(Node->
getLHS());
153 PrintExpr(Node->
getRHS());
160 void StmtPrinter::VisitDefaultStmt(
DefaultStmt *Node) {
161 Indent(-1) <<
"default:\n";
165 void StmtPrinter::VisitLabelStmt(
LabelStmt *Node) {
178 void StmtPrinter::PrintRawIfStmt(
IfStmt *If) {
181 PrintRawDeclStmt(DS);
188 PrintRawCompoundStmt(CS);
189 OS << (If->
getElse() ?
' ' :
'\n');
201 PrintRawCompoundStmt(CS);
203 }
else if (
IfStmt *ElseIf = dyn_cast<IfStmt>(Else)) {
205 PrintRawIfStmt(ElseIf);
213 void StmtPrinter::VisitIfStmt(
IfStmt *If) {
218 void StmtPrinter::VisitSwitchStmt(
SwitchStmt *Node) {
221 PrintRawDeclStmt(DS);
229 PrintRawCompoundStmt(CS);
237 void StmtPrinter::VisitWhileStmt(
WhileStmt *Node) {
240 PrintRawDeclStmt(DS);
247 void StmtPrinter::VisitDoStmt(
DoStmt *Node) {
250 PrintRawCompoundStmt(CS);
263 void StmtPrinter::VisitForStmt(
ForStmt *Node) {
267 PrintRawDeclStmt(DS);
269 PrintExpr(cast<Expr>(Node->
getInit()));
279 PrintExpr(Node->
getInc());
284 PrintRawCompoundStmt(CS);
295 PrintRawDeclStmt(DS);
303 PrintRawCompoundStmt(CS);
314 SubPolicy.SuppressInitializers =
true;
321 if (Policy.IncludeNewlines) OS <<
"\n";
327 OS <<
"__if_exists (";
329 OS <<
"__if_not_exists (";
333 Qualifier->print(OS, Policy);
340 void StmtPrinter::VisitGotoStmt(
GotoStmt *Node) {
342 if (Policy.IncludeNewlines) OS <<
"\n";
349 if (Policy.IncludeNewlines) OS <<
"\n";
352 void StmtPrinter::VisitContinueStmt(
ContinueStmt *Node) {
354 if (Policy.IncludeNewlines) OS <<
"\n";
357 void StmtPrinter::VisitBreakStmt(
BreakStmt *Node) {
359 if (Policy.IncludeNewlines) OS <<
"\n";
363 void StmtPrinter::VisitReturnStmt(
ReturnStmt *Node) {
370 if (Policy.IncludeNewlines) OS <<
"\n";
374 void StmtPrinter::VisitGCCAsmStmt(
GCCAsmStmt *Node) {
388 for (
unsigned i = 0, e = Node->
getNumOutputs(); i != e; ++i) {
408 for (
unsigned i = 0, e = Node->
getNumInputs(); i != e; ++i) {
436 if (Policy.IncludeNewlines) OS <<
"\n";
439 void StmtPrinter::VisitMSAsmStmt(
MSAsmStmt *Node) {
449 void StmtPrinter::VisitCapturedStmt(
CapturedStmt *Node) {
456 PrintRawCompoundStmt(TS);
469 PrintRawCompoundStmt(CS);
477 PrintRawCompoundStmt(dyn_cast<CompoundStmt>(FS->getFinallyBody()));
486 Indent() <<
"@catch (...) { /* todo */ } \n";
499 Indent() <<
"@synchronized (";
507 Indent() <<
"@autoreleasepool";
508 PrintRawCompoundStmt(dyn_cast<CompoundStmt>(Node->
getSubStmt()));
512 void StmtPrinter::PrintRawCXXCatchStmt(
CXXCatchStmt *Node) {
515 PrintRawDecl(ExDecl);
522 void StmtPrinter::VisitCXXCatchStmt(
CXXCatchStmt *Node) {
524 PrintRawCXXCatchStmt(Node);
528 void StmtPrinter::VisitCXXTryStmt(
CXXTryStmt *Node) {
538 void StmtPrinter::VisitSEHTryStmt(
SEHTryStmt *Node) {
544 PrintRawSEHExceptHandler(E);
546 assert(F &&
"Must have a finally block...");
547 PrintRawSEHFinallyStmt(F);
554 PrintRawCompoundStmt(Node->
getBlock());
558 void StmtPrinter::PrintRawSEHExceptHandler(
SEHExceptStmt *Node) {
562 PrintRawCompoundStmt(Node->
getBlock());
568 PrintRawSEHExceptHandler(Node);
574 PrintRawSEHFinallyStmt(Node);
578 void StmtPrinter::VisitSEHLeaveStmt(
SEHLeaveStmt *Node) {
580 if (Policy.IncludeNewlines) OS <<
"\n";
592 template <
typename T>
593 void VisitOMPClauseList(T *Node,
char StartSym);
596 : OS(OS), Policy(Policy) { }
597 #define OPENMP_CLAUSE(Name, Class) \
598 void Visit##Class(Class *S);
599 #include "clang/Basic/OpenMPKinds.def"
602 void OMPClausePrinter::VisitOMPIfClause(
OMPIfClause *Node) {
604 Node->
getCondition()->printPretty(OS,
nullptr, Policy, 0);
608 void OMPClausePrinter::VisitOMPFinalClause(
OMPFinalClause *Node) {
610 Node->
getCondition()->printPretty(OS,
nullptr, Policy, 0);
615 OS <<
"num_threads(";
622 Node->
getSafelen()->printPretty(OS,
nullptr, Policy, 0);
670 void OMPClausePrinter::VisitOMPReadClause(
OMPReadClause *) { OS <<
"read"; }
672 void OMPClausePrinter::VisitOMPWriteClause(
OMPWriteClause *) { OS <<
"write"; }
687 void OMPClausePrinter::VisitOMPClauseList(T *Node,
char StartSym) {
688 for (
typename T::varlist_iterator I = Node->varlist_begin(),
689 E = Node->varlist_end();
691 assert(*I &&
"Expected non-null Stmt");
692 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(*I)) {
693 OS << (I == Node->varlist_begin() ? StartSym :
',');
694 cast<NamedDecl>(DRE->getDecl())->printQualifiedName(OS);
696 OS << (I == Node->varlist_begin() ? StartSym :
',');
697 (*I)->printPretty(OS,
nullptr, Policy, 0);
705 VisitOMPClauseList(Node,
'(');
712 OS <<
"firstprivate";
713 VisitOMPClauseList(Node,
'(');
721 VisitOMPClauseList(Node,
'(');
729 VisitOMPClauseList(Node,
'(');
741 if (QualifierLoc ==
nullptr && OOK !=
OO_None) {
746 if (QualifierLoc !=
nullptr)
747 QualifierLoc->
print(OS, Policy);
751 VisitOMPClauseList(Node,
' ');
759 VisitOMPClauseList(Node,
'(');
760 if (Node->getStep() !=
nullptr) {
762 Node->getStep()->printPretty(OS,
nullptr, Policy, 0);
769 if (!Node->varlist_empty()) {
771 VisitOMPClauseList(Node,
'(');
774 Node->
getAlignment()->printPretty(OS,
nullptr, Policy, 0);
781 if (!Node->varlist_empty()) {
783 VisitOMPClauseList(Node,
'(');
789 if (!Node->varlist_empty()) {
791 VisitOMPClauseList(Node,
'(');
796 void OMPClausePrinter::VisitOMPFlushClause(
OMPFlushClause *Node) {
797 if (!Node->varlist_empty()) {
798 VisitOMPClauseList(Node,
'(');
804 if (!Node->varlist_empty()) {
809 VisitOMPClauseList(Node,
' ');
820 OMPClausePrinter Printer(OS, Policy);
824 if (*I && !(*I)->isImplicit()) {
831 "Expected captured statement!");
838 Indent() <<
"#pragma omp parallel ";
839 PrintOMPExecutableDirective(Node);
843 Indent() <<
"#pragma omp simd ";
844 PrintOMPExecutableDirective(Node);
848 Indent() <<
"#pragma omp for ";
849 PrintOMPExecutableDirective(Node);
853 Indent() <<
"#pragma omp for simd ";
854 PrintOMPExecutableDirective(Node);
858 Indent() <<
"#pragma omp sections ";
859 PrintOMPExecutableDirective(Node);
863 Indent() <<
"#pragma omp section";
864 PrintOMPExecutableDirective(Node);
868 Indent() <<
"#pragma omp single ";
869 PrintOMPExecutableDirective(Node);
873 Indent() <<
"#pragma omp master";
874 PrintOMPExecutableDirective(Node);
878 Indent() <<
"#pragma omp critical";
884 PrintOMPExecutableDirective(Node);
888 Indent() <<
"#pragma omp parallel for ";
889 PrintOMPExecutableDirective(Node);
892 void StmtPrinter::VisitOMPParallelForSimdDirective(
894 Indent() <<
"#pragma omp parallel for simd ";
895 PrintOMPExecutableDirective(Node);
898 void StmtPrinter::VisitOMPParallelSectionsDirective(
900 Indent() <<
"#pragma omp parallel sections ";
901 PrintOMPExecutableDirective(Node);
905 Indent() <<
"#pragma omp task ";
906 PrintOMPExecutableDirective(Node);
910 Indent() <<
"#pragma omp taskyield";
911 PrintOMPExecutableDirective(Node);
915 Indent() <<
"#pragma omp barrier";
916 PrintOMPExecutableDirective(Node);
920 Indent() <<
"#pragma omp taskwait";
921 PrintOMPExecutableDirective(Node);
925 Indent() <<
"#pragma omp taskgroup";
926 PrintOMPExecutableDirective(Node);
930 Indent() <<
"#pragma omp flush ";
931 PrintOMPExecutableDirective(Node);
935 Indent() <<
"#pragma omp ordered";
936 PrintOMPExecutableDirective(Node);
940 Indent() <<
"#pragma omp atomic ";
941 PrintOMPExecutableDirective(Node);
945 Indent() <<
"#pragma omp target ";
946 PrintOMPExecutableDirective(Node);
950 Indent() <<
"#pragma omp teams ";
951 PrintOMPExecutableDirective(Node);
954 void StmtPrinter::VisitOMPCancellationPointDirective(
956 Indent() <<
"#pragma omp cancellation point "
958 PrintOMPExecutableDirective(Node);
962 Indent() <<
"#pragma omp cancel "
964 PrintOMPExecutableDirective(Node);
970 void StmtPrinter::VisitDeclRefExpr(
DeclRefExpr *Node) {
972 Qualifier->print(OS, Policy);
981 void StmtPrinter::VisitDependentScopeDeclRefExpr(
984 Qualifier->print(OS, Policy);
1007 OS << (Node->
isArrow() ?
"->" :
".");
1084 if (value < 256 &&
isPrintable((
unsigned char)value))
1085 OS <<
"'" << (
char)value <<
"'";
1086 else if (value < 256)
1087 OS <<
"'\\x" << llvm::format(
"%02x", value) <<
"'";
1088 else if (value <= 0xFFFF)
1089 OS <<
"'\\u" << llvm::format(
"%04x", value) <<
"'";
1091 OS <<
"'\\U" << llvm::format(
"%08x", value) <<
"'";
1097 OS << Node->
getValue().toString(10, isSigned);
1101 default: llvm_unreachable(
"Unexpected type for integer literal!");
1102 case BuiltinType::Char_S:
1103 case BuiltinType::Char_U: OS <<
"i8";
break;
1104 case BuiltinType::UChar: OS <<
"Ui8";
break;
1105 case BuiltinType::Short: OS <<
"i16";
break;
1106 case BuiltinType::UShort: OS <<
"Ui16";
break;
1107 case BuiltinType::Int:
break;
1108 case BuiltinType::UInt: OS <<
'U';
break;
1109 case BuiltinType::Long: OS <<
'L';
break;
1110 case BuiltinType::ULong: OS <<
"UL";
break;
1111 case BuiltinType::LongLong: OS <<
"LL";
break;
1112 case BuiltinType::ULongLong: OS <<
"ULL";
break;
1113 case BuiltinType::Int128: OS <<
"i128";
break;
1114 case BuiltinType::UInt128: OS <<
"Ui128";
break;
1123 if (Str.find_first_not_of(
"-0123456789") == StringRef::npos)
1131 default: llvm_unreachable(
"Unexpected type for float literal!");
1132 case BuiltinType::Half:
break;
1133 case BuiltinType::Double:
break;
1134 case BuiltinType::Float: OS <<
'F';
break;
1135 case BuiltinType::LongDouble: OS <<
'L';
break;
1151 void StmtPrinter::VisitParenExpr(
ParenExpr *Node) {
1182 void StmtPrinter::VisitOffsetOfExpr(
OffsetOfExpr *Node) {
1183 OS <<
"__builtin_offsetof(";
1186 bool PrintedSomething =
false;
1194 PrintedSomething =
true;
1207 if (PrintedSomething)
1210 PrintedSomething =
true;
1222 if (Policy.LangOpts.CPlusPlus)
1224 else if (Policy.LangOpts.C11)
1233 OS <<
"__builtin_omp_required_simd_align";
1255 T.
print(OS, Policy);
1263 PrintExpr(Node->
getLHS());
1265 PrintExpr(Node->
getRHS());
1269 void StmtPrinter::PrintCallArgs(
CallExpr *Call) {
1270 for (
unsigned i = 0, e = Call->
getNumArgs(); i != e; ++i) {
1271 if (isa<CXXDefaultArgExpr>(Call->
getArg(i))) {
1277 PrintExpr(Call->
getArg(i));
1281 void StmtPrinter::VisitCallExpr(
CallExpr *Call) {
1284 PrintCallArgs(Call);
1287 void StmtPrinter::VisitMemberExpr(
MemberExpr *Node) {
1293 ? dyn_cast<
FieldDecl>(ParentMember->getMemberDecl()) :
nullptr;
1295 if (!ParentDecl || !ParentDecl->isAnonymousStructOrUnion())
1296 OS << (Node->
isArrow() ?
"->" :
".");
1299 if (FD->isAnonymousStructOrUnion())
1303 Qualifier->
print(OS, Policy);
1311 void StmtPrinter::VisitObjCIsaExpr(
ObjCIsaExpr *Node) {
1313 OS << (Node->
isArrow() ?
"->isa" :
".isa");
1338 PrintExpr(Node->
getLHS());
1340 PrintExpr(Node->
getRHS());
1343 PrintExpr(Node->
getLHS());
1345 PrintExpr(Node->
getRHS());
1350 PrintExpr(Node->
getLHS());
1352 PrintExpr(Node->
getRHS());
1367 void StmtPrinter::VisitStmtExpr(
StmtExpr *E) {
1373 void StmtPrinter::VisitChooseExpr(
ChooseExpr *Node) {
1374 OS <<
"__builtin_choose_expr(";
1377 PrintExpr(Node->
getLHS());
1379 PrintExpr(Node->
getRHS());
1383 void StmtPrinter::VisitGNUNullExpr(
GNUNullExpr *) {
1388 OS <<
"__builtin_shufflevector(";
1397 OS <<
"__builtin_convertvector(";
1404 void StmtPrinter::VisitInitListExpr(
InitListExpr* Node) {
1411 for (
unsigned i = 0, e = Node->
getNumInits(); i != e; ++i) {
1423 for (
unsigned i = 0, e = Node->
getNumExprs(); i != e; ++i) {
1431 bool NeedsEquals =
true;
1435 if (D->isFieldDesignator()) {
1436 if (D->getDotLoc().isInvalid()) {
1438 OS << II->getName() <<
":";
1439 NeedsEquals =
false;
1442 OS <<
"." << D->getFieldName()->getName();
1446 if (D->isArrayDesignator()) {
1464 void StmtPrinter::VisitDesignatedInitUpdateExpr(
1471 OS <<
"/*updater*/";
1476 void StmtPrinter::VisitNoInitExpr(
NoInitExpr *Node) {
1477 OS <<
"/*no init*/";
1481 if (Policy.LangOpts.CPlusPlus) {
1482 OS <<
"/*implicit*/";
1486 OS <<
"/*implicit*/(";
1496 void StmtPrinter::VisitVAArgExpr(
VAArgExpr *Node) {
1497 OS <<
"__builtin_va_arg(";
1508 void StmtPrinter::VisitAtomicExpr(
AtomicExpr *Node) {
1509 const char *Name =
nullptr;
1510 switch (Node->
getOp()) {
1511 #define BUILTIN(ID, TYPE, ATTRS)
1512 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) \
1513 case AtomicExpr::AO ## ID: \
1516 #include "clang/Basic/Builtins.def"
1521 PrintExpr(Node->
getPtr());
1522 if (Node->
getOp() != AtomicExpr::AO__c11_atomic_load &&
1523 Node->
getOp() != AtomicExpr::AO__atomic_load_n) {
1527 if (Node->
getOp() == AtomicExpr::AO__atomic_exchange ||
1532 if (Node->
getOp() == AtomicExpr::AO__atomic_compare_exchange ||
1533 Node->
getOp() == AtomicExpr::AO__atomic_compare_exchange_n) {
1537 if (Node->
getOp() != AtomicExpr::AO__c11_atomic_init) {
1552 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \
1554 #include "clang/Basic/OperatorKinds.def"
1558 if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
1560 OS << OpStrings[
Kind] <<
' ';
1561 PrintExpr(Node->
getArg(0));
1563 PrintExpr(Node->
getArg(0));
1564 OS <<
' ' << OpStrings[
Kind];
1566 }
else if (Kind == OO_Arrow) {
1567 PrintExpr(Node->
getArg(0));
1568 }
else if (Kind == OO_Call) {
1569 PrintExpr(Node->
getArg(0));
1571 for (
unsigned ArgIdx = 1; ArgIdx < Node->
getNumArgs(); ++ArgIdx) {
1574 if (!isa<CXXDefaultArgExpr>(Node->
getArg(ArgIdx)))
1575 PrintExpr(Node->
getArg(ArgIdx));
1578 }
else if (Kind == OO_Subscript) {
1579 PrintExpr(Node->
getArg(0));
1581 PrintExpr(Node->
getArg(1));
1584 OS << OpStrings[
Kind] <<
' ';
1585 PrintExpr(Node->
getArg(0));
1587 PrintExpr(Node->
getArg(0));
1588 OS <<
' ' << OpStrings[
Kind] <<
' ';
1589 PrintExpr(Node->
getArg(1));
1591 llvm_unreachable(
"unknown overloaded operator");
1598 if (MD && isa<CXXConversionDecl>(MD)) {
1602 VisitCallExpr(cast<CallExpr>(Node));
1610 PrintCallArgs(Node);
1623 VisitCXXNamedCastExpr(Node);
1627 VisitCXXNamedCastExpr(Node);
1631 VisitCXXNamedCastExpr(Node);
1635 VisitCXXNamedCastExpr(Node);
1666 Qualifier->print(OS, Policy);
1678 cast<FunctionDecl>(DRE->
getDecl())->getTemplateSpecializationArgs();
1681 if (Args->size() != 1) {
1684 OS, Args->data(), Args->size(), Policy);
1691 char C = (char)
P.getAsIntegral().getZExtValue();
1699 OS << Int->
getValue().toString(10,
false);
1717 OS << (Node->
getValue() ?
"true" :
"false");
1724 void StmtPrinter::VisitCXXThisExpr(
CXXThisExpr *Node) {
1728 void StmtPrinter::VisitCXXThrowExpr(
CXXThrowExpr *Node) {
1770 Arg != ArgEnd; ++Arg) {
1771 if (Arg->isDefaultArgument())
1785 void StmtPrinter::VisitLambdaExpr(
LambdaExpr *Node) {
1787 bool NeedComma =
false;
1810 switch (
C->getCaptureKind()) {
1818 OS <<
C->getCapturedVar()->getName();
1822 OS <<
C->getCapturedVar()->getName();
1825 llvm_unreachable(
"VLA type in explicit captures.");
1829 PrintExpr(
C->getCapturedVar()->getInit());
1837 for (
auto P : Method->
params()) {
1843 std::string ParamStr =
P->getNameAsString();
1844 P->getOriginalType().print(OS, Policy, ParamStr);
1877 TSInfo->getType().print(OS, Policy);
1883 void StmtPrinter::VisitCXXNewExpr(
CXXNewExpr *E) {
1891 for (
unsigned i = 1; i < NumPlace; ++i) {
1903 llvm::raw_string_ostream s(TypeS);
1905 Size->printPretty(s, Helper, Policy);
1942 OS << II->getName();
1951 for (
unsigned i = 0, e = E->
getNumArgs(); i != e; ++i) {
1952 if (isa<CXXDefaultArgExpr>(E->
getArg(i))) {
1975 StmtPrinter::VisitCXXUnresolvedConstructExpr(
1981 Arg != ArgEnd; ++Arg) {
1989 void StmtPrinter::VisitCXXDependentScopeMemberExpr(
1993 OS << (Node->
isArrow() ?
"->" :
".");
1996 Qualifier->print(OS, Policy);
2008 OS << (Node->
isArrow() ?
"->" :
".");
2011 Qualifier->print(OS, Policy);
2022 #define TYPE_TRAIT_1(Spelling, Name, Key) \
2023 case clang::UTT_##Name: return #Spelling;
2024 #define TYPE_TRAIT_2(Spelling, Name, Key) \
2025 case clang::BTT_##Name: return #Spelling;
2026 #define TYPE_TRAIT_N(Spelling, Name, Key) \
2027 case clang::TT_##Name: return #Spelling;
2028 #include "clang/Basic/TokenKinds.def"
2030 llvm_unreachable(
"Type trait not covered by switch");
2038 llvm_unreachable(
"Array type trait not covered by switch");
2046 llvm_unreachable(
"Expression type trait not covered by switch");
2051 for (
unsigned I = 0, N = E->
getNumArgs(); I != N; ++I) {
2083 OS <<
"sizeof...(" << *E->
getPack() <<
")";
2086 void StmtPrinter::VisitSubstNonTypeTemplateParmPackExpr(
2091 void StmtPrinter::VisitSubstNonTypeTemplateParmExpr(
2104 void StmtPrinter::VisitCXXFoldExpr(
CXXFoldExpr *E) {
2133 if (ch.first != ch.second) {
2137 if (ch.first == ch.second)
break;
2153 Visit(Element.
Value);
2173 OS <<
"@protocol(" << *Node->
getProtocol() <<
')';
2198 for (
unsigned i = 0, e = Mess->
getNumArgs(); i != e; ++i) {
2200 if (i > 0) OS <<
' ';
2208 PrintExpr(Mess->
getArg(i));
2215 OS << (Node->
getValue() ?
"__objc_yes" :
"__objc_no");
2231 void StmtPrinter::VisitBlockExpr(
BlockExpr *Node) {
2237 if (isa<FunctionNoProtoType>(AFT)) {
2239 }
else if (!BD->
param_empty() || cast<FunctionProtoType>(AFT)->isVariadic()) {
2244 std::string ParamStr = (*AI)->getNameAsString();
2245 (*AI)->getType().print(OS, Policy, ParamStr);
2262 void StmtPrinter::VisitTypoExpr(
TypoExpr *Node) {
2264 assert(
false &&
"Cannot print TypoExpr nodes");
2267 void StmtPrinter::VisitAsTypeExpr(
AsTypeExpr *Node) {
2268 OS <<
"__builtin_astype(";
2283 void Stmt::printPretty(raw_ostream &OS,
2286 unsigned Indentation)
const {
2287 StmtPrinter
P(OS, Helper, Policy, Indentation);
2288 P.Visit(const_cast<Stmt*>(
this));
A call to an overloaded operator written using operator syntax.
The receiver is the instance of the superclass object.
Represents a single C99 designator.
Raw form: operator "" X (const char *)
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Defines the clang::ASTContext interface.
unsigned getNumInits() const
This represents '#pragma omp master' directive.
operator "" X (long double)
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
const Expr * getBase() const
The null pointer literal (C++11 [lex.nullptr])
This represents '#pragma omp task' directive.
CapturedDecl * getCapturedDecl()
Retrieve the outlined function declaration.
unsigned getNumOutputs() const
The receiver is an object instance.
bool hasExplicitResultType() const
Whether this lambda had its result type explicitly specified.
StringRef getName() const
Expr * getSyntacticForm()
Smart pointer class that efficiently represents Objective-C method names.
llvm::iterator_range< pack_iterator > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
This represents clause 'copyin' in the '#pragma omp ...' directives.
bool hasTemplateKeyword() const
Determines whether the name in this declaration reference was preceded by the template keyword...
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
bool hasExplicitTemplateArgs() const
Determines whether this expression had explicit template arguments.
ArrayRef< OMPClause * > clauses()
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Expr * getExpr(unsigned Index)
getExpr - Return the Expr at the specified index.
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
CompoundStmt * getSubStmt()
CharacterKind getKind() const
CXXCatchStmt * getHandler(unsigned i)
bool isArgumentType() const
Expr * getInit() const
Retrieve the initializer value.
bool isGlobalDelete() const
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
This represents '#pragma omp for simd' directive.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
TypeSourceInfo * getTypeSourceInfo() const
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
bool isRecordType() const
param_iterator param_end()
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
This represents 'if' clause in the '#pragma omp ...' directive.
Defines the C++ template declaration subclasses.
Represents an attribute applied to a statement.
TypeSourceInfo * getArg(unsigned I) const
Retrieve the Ith argument.
Represents Objective-C's @throw statement.
const char * getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type)
InitListExpr * getSyntacticForm() const
Represents a call to a C++ constructor.
bool hasExplicitTemplateArgs() const
Determines whether this lookup had explicit template arguments.
TypeSourceInfo * getTypeSourceInfo() const
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
A container of type source information.
This represents 'update' clause in the '#pragma omp atomic' directive.
static void printGroup(Decl **Begin, unsigned NumDecls, raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation=0)
const Stmt * getElse() const
This represents '#pragma omp parallel for' directive.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
unsigned getNumTemplateArgs() const
Expr * getAlignment()
Returns alignment.
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
CompoundStmt * getBlock() const
IdentType getIdentType() const
Expr * getIndexExpr(unsigned Idx)
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
This represents 'read' clause in the '#pragma omp atomic' directive.
Expr * getOperand() const
This represents clause 'private' in the '#pragma omp ...' directives.
This represents 'num_threads' clause in the '#pragma omp ...' directive.
const Expr * getCallee() const
const FunctionProtoType * getFunctionType() const
getFunctionType - Return the underlying function type for this block.
void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const
bool hasExplicitParameters() const
Determine whether this lambda has an explicit parameter list vs. an implicit (empty) parameter list...
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
UnaryExprOrTypeTrait getKind() const
bool varlist_empty() const
An implicit indirection through a C++ base class, when the field found is in a base class...
This represents implicit clause 'flush' for the '#pragma omp flush' directive. This clause does not e...
Describes how types, statements, expressions, and declarations should be printed. ...
unsigned getValue() const
A C++ throw-expression (C++ [except.throw]).
ParmVarDecl - Represents a parameter to a function.
Defines the clang::Expr interface and subclasses for C++ expressions.
Expr * getArrayIndex(const Designator &D) const
ArrayTypeTrait getTrait() const
This represents 'safelen' clause in the '#pragma omp ...' directive.
A C++ static_cast expression (C++ [expr.static.cast]).
Expr * IgnoreImpCasts() LLVM_READONLY
Represents a C99 designated initializer expression.
Expr * getNumThreads() const
Returns number of threads.
DeclarationName getName() const
getName - Returns the embedded declaration name.
ObjCProtocolDecl * getProtocol() const
CompoundStmt * getSubStmt() const
Retrieve the compound statement that will be included in the program only if the existence of the sym...
An element in an Objective-C dictionary literal.
This represents '#pragma omp parallel' directive.
unsigned getNumInputs() const
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ObjCInterfaceDecl * getClassReceiver() const
LambdaCaptureDefault getCaptureDefault() const
Determine the default capture kind for this lambda.
unsigned getNumAssocs() const
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
Expr * getBase()
Retrieve the base object of this member expressions, e.g., the x in x.m.
Represents a place-holder for an object not to be initialized by anything.
StringLiteral * getString()
Expr * getImplicitObjectArgument() const
Retrieves the implicit object argument for the member call.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
CXXMethodDecl * getCallOperator() const
Retrieve the function call operator associated with this lambda expression.
Expr * getPlacementArg(unsigned i)
DeclarationNameInfo getNameInfo() const
Retrieve the name of the entity we're testing for, along with location information.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
IdentifierInfo & getAccessor() const
QualType getQueriedType() const
This represents '#pragma omp barrier' directive.
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
This represents '#pragma omp critical' directive.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
Expr * getFilterExpr() const
const VarDecl * getCatchParamDecl() const
Represents Objective-C's @catch statement.
const CompoundStmt * getSynchBody() const
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
Describes an C or C++ initializer list.
const LangOptions & getLangOpts() const
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
Capturing by copy (a.k.a., by value)
DeclarationNameInfo getNameInfo() const
QualType getReturnType() const
bool isSuperReceiver() const
Stmt * getHandlerBlock() const
Expr * getInitializer()
The initializer of this new-expression.
Expr * getExprOperand() const
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the full name info for the member that this expression refers to.
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
const Expr * getSubExpr() const
A builtin binary operation expression such as "x + y" or "x <= y".
Selector getSelector() const
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
Expr * getOutputExpr(unsigned i)
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
This represents '#pragma omp cancellation point' directive.
This represents 'default' clause in the '#pragma omp ...' directive.
bool isVariadic() const
Whether this function is variadic.
QualType getTypeAsWritten() const
const DeclStmt * getConditionVariableDeclStmt() const
Expr * getBaseExpr() const
New-expression has a C++98 paren-delimited initializer.
const Stmt * getCatchBody() const
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
This represents '#pragma omp teams' directive.
StringRef getBridgeKindName() const
Retrieve the kind of bridge being performed as a string.
This represents clause 'reduction' in the '#pragma omp ...' directives.
Represents binding an expression to a temporary.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
StringLiteral * getClobberStringLiteral(unsigned i)
CompoundStmt * getBody() const
Retrieve the body of the lambda.
ArrayTypeTrait
Names for the array type traits.
Expr * Key
The key for the dictionary element.
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...
Represents a C++ member access expression where the actual member referenced could not be resolved be...
const Expr * getBase() const
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.').
A default argument (C++ [dcl.fct.default]).
ExpressionTrait getTrait() const
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name. Otherwise, returns NULL.
Represents the this expression in C++.
MSPropertyDecl * getPropertyDecl() const
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
TypeTrait
Names for traits that operate specifically on types.
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
OpenMPDirectiveKind getCancelRegion() const
Get cancellation region for the current cancellation point.
llvm::APInt getValue() const
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
StringRef getAsmString() const
CXXMethodDecl * getMethodDecl() const
Retrieves the declaration of the called method.
This represents '#pragma omp taskgroup' directive.
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
const Expr * getControllingExpr() const
This represents clause 'aligned' in the '#pragma omp ...' directives.
Expr * getQueriedExpression() const
NestedNameSpecifierLoc getQualifierLoc() const
VAArgExpr, used for the builtin function __builtin_va_arg.
bool isPackExpansion() const
Determines whether this dictionary element is a pack expansion.
bool isUnarySelector() const
This represents implicit clause 'depend' for the '#pragma omp task' directive.
designators_iterator designators_begin()
unsigned getNumExprs() const
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
bool isMutable() const
Determine whether the lambda is mutable, meaning that any captures values can be modified.
This represents 'capture' clause in the '#pragma omp atomic' directive.
StringRef getName() const
Return the actual identifier string.
const Expr * getExpr(unsigned Init) const
void outputString(raw_ostream &OS) const
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
unsigned getNumArgs() const
static void PrintFloatingLiteral(raw_ostream &OS, FloatingLiteral *Node, bool PrintSuffix)
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Expr * getCondition() const
Returns condition.
Represents a C++ functional cast expression that builds a temporary object.
A C++ const_cast expression (C++ [expr.const.cast]).
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
Stmt * getBody() const override
ObjCMethodDecl * getImplicitPropertyGetter() const
Expr * getArrayRangeStart(const Designator &D) const
Represents Objective-C's @synchronized statement.
ObjCSelectorExpr used for @selector in Objective-C.
bool isImplicitAccess() const
True if this is an implicit access, i.e., one in which the member being accessed was not written in t...
Represents an expression that computes the length of a parameter pack.
This represents 'ordered' clause in the '#pragma omp ...' directive.
Selector getSelector() const
NonTypeTemplateParmDecl * getParameterPack() const
Retrieve the non-type template parameter pack being substituted.
QualType getAllocatedType() const
StringRef getInputName(unsigned i) const
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine()) const
Expr * getSubExpr() const
This represents '#pragma omp for' directive.
Represents a folding of a pack over an operator.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
An expression that sends a message to the given Objective-C object or class.
unsigned getNumComponents() const
const DeclStmt * getConditionVariableDeclStmt() const
A member reference to an MSPropertyDecl.
DeclarationName getDeclName() const
Represents a reference to a non-type template parameter that has been substituted with a template arg...
This represents '#pragma omp cancel' directive.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
This represents '#pragma omp flush' directive.
This represents '#pragma omp parallel for simd' directive.
InitListExpr * getUpdater() const
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
unsigned getNumSubExprs() const
param_iterator param_begin()
LabelDecl * getLabel() const
unsigned getNumTemplateArgs() const
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
const StringLiteral * getAsmString() const
This captures a statement into a function. For example, the following pragma annotated compound state...
operator "" X (const CharT *, size_t)
Expr * getArrayRangeEnd(const Designator &D) const
Raw form: operator "" X<cs...> ()
Expr * getNumForLoops() const
Return the number of associated for-loops.
This represents '#pragma omp single' directive.
TemplateArgumentLoc const * getTemplateArgs() const
Expr * getSourceExpr() const
This is a basic class for representing single OpenMP executable directive.
bool isValid() const
Return true if this is a valid SourceLocation object.
OverloadedOperatorKind getCXXOverloadedOperator() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies this name, if any.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
static const char * getExpressionTraitName(ExpressionTrait ET)
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit...
Expr * getCondition() const
Returns condition.
This represents 'schedule' clause in the '#pragma omp ...' directive.
StringRef getNameForSlot(unsigned argIndex) const
Retrieve the name at a given position in the selector.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
CompoundStmt * getBlock() const
This represents clause 'shared' in the '#pragma omp ...' directives.
const Expr * getCond() const
Represents a static or instance method of a struct/union/class.
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
This represents '#pragma omp taskwait' directive.
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
bool isImplicitAccess() const
True if this is an implicit access, i.e. one in which the member being accessed was not written in th...
NamedDecl * getPack() const
Retrieve the parameter pack.
bool isInitCapture(const LambdaCapture *Capture) const
Determine whether one of this lambda's captures is an init-capture.
LiteralOperatorKind getLiteralOperatorKind() const
Returns the kind of literal operator invocation which this expression represents. ...
capture_iterator explicit_capture_end() const
Retrieve an iterator pointing past the end of the sequence of explicit lambda captures.
QualType getAssocType(unsigned i) const
ParmVarDecl * getParameterPack() const
Get the parameter pack which this expression refers to.
SEHExceptStmt * getExceptHandler() const
Returns 0 if not defined.
This represents '#pragma omp target' directive.
Expr * getInputExpr(unsigned i)
static const char * getTypeTraitName(TypeTrait TT)
TypeTrait getTrait() const
Determine which type trait this expression uses.
StringRef getOutputName(unsigned i) const
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
An expression trait intrinsic.
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
This represents '#pragma omp ordered' directive.
const Expr * getBase() const
const BlockDecl * getBlockDecl() const
bool isObjectReceiver() const
bool isParenTypeId() const
QualType getType() const
Return the type wrapped by this type source info.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name...
const OffsetOfNode & getComponent(unsigned Idx) const
A qualified reference to a name whose declaration cannot yet be resolved.
Expr * Value
The value of the dictionary element.
Represents a C11 generic selection.
const char * getCastName() const
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
AddrLabelExpr - The GNU address of label extension, representing &&label.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
ast_type_traits::DynTypedNode Node
Represents a reference to a function parameter pack that has been substituted but not yet expanded...
Represents a template argument.
Expr * getReplacement() const
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition. The opaque value will...
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
Print this nested name specifier to the given output stream.
const Expr * getSubExpr() const
bool isImplicitProperty() const
const internal::VariadicDynCastAllOfMatcher< Stmt, CXXCatchStmt > catchStmt
Matches catch statements.
const Expr * getAssocExpr(unsigned i) const
StringRef getOpcodeStr() const
[C99 6.4.2.2] - A predefined identifier such as func.
Represents a delete expression for memory deallocation and destructor calls, e.g. "delete[] pArray"...
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
TemplateArgumentLoc const * getTemplateArgs() const
static LLVM_READONLY bool isPrintable(unsigned char c)
const Stmt * getBody() const
This represents '#pragma omp section' directive.
SourceLocation getLParenLoc() const
bool isClassReceiver() const
designators_iterator designators_end()
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
This represents '#pragma omp simd' directive.
const Expr * getSynchExpr() const
unsigned getNumHandlers() const
Kind getKind() const
Determine what kind of offsetof node this is.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
Represents a C++11 pack expansion that produces a sequence of expressions.
unsigned getNumPlacementArgs() const
This represents clause 'linear' in the '#pragma omp ...' directives.
DeclarationNameInfo getDirectiveName() const
Return name of the directive.
Selector getSelector() const
bool isTypeOperand() const
void printName(raw_ostream &OS) const
printName - Print the human-readable name to a stream.
const Expr * getRetValue() const
unsigned getNumArgs() const
unsigned getNumArgs() const
This represents '#pragma omp atomic' directive.
Expr * getBaseExpr() const
llvm::APFloat getValue() const
const Stmt * getThen() const
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Capturing variable-length array type.
Not an overloaded operator.
Expr * getSafelen() const
Return safe iteration space distance.
void print(raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
const Stmt * getSubStmt() const
capture_iterator explicit_capture_begin() const
Retrieve an iterator pointing to the first explicit lambda capture.
Represents Objective-C's collection statement.
static StringRef getIdentTypeName(IdentType IT)
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword...
Represents a call to a CUDA kernel function.
Expr * getArg(unsigned Arg)
Return the specified argument.
Expr * getExprOperand() const
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Represents Objective-C's @finally statement.
const Expr * getSubExpr() const
Expr * getKeyExpr() const
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver. ...
LabelDecl * getLabel() const
const DeclStmt * getConditionVariableDeclStmt() const
Capturing the this pointer.
This represents 'write' clause in the '#pragma omp atomic' directive.
ObjCPropertyDecl * getExplicitProperty() const
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
const char * getOpenMPDirectiveName(OpenMPDirectiveKind Kind)
const Expr * getInitializer() const
ObjCIvarRefExpr - A reference to an ObjC instance variable.
bool hasAssociatedStmt() const
Returns true if directive has associated statement.
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
void printExceptionSpecification(raw_ostream &OS, const PrintingPolicy &Policy) const
ArrayRef< const Attr * > getAttrs() const
A use of a default initializer in a constructor or in aggregate initialization.
A template argument list.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const StringLiteral * getInputConstraintLiteral(unsigned i) const
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
const Expr * getSubExpr() const
const IdentifierInfo * getUDSuffix() const
Returns the ud-suffix specified for this literal.
This represents 'nowait' clause in the '#pragma omp ...' directive.
QualType getEncodedType() const
VarDecl * getLoopVariable()
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
const Expr * getCond() const
CompoundStmt * getTryBlock()
Represents Objective-C's @try ... @catch ... @finally statement.
const Expr * getThrowExpr() const
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
Expr * getPattern()
Retrieve the pattern of the pack expansion.
bool isIfExists() const
Determine whether this is an __if_exists statement.
static Decl::Kind getKind(const Decl *D)
Abstract class common to all of the C++ "named"/"keyword" casts.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
This represents '#pragma omp sections' directive.
const Stmt * getTryBody() const
Retrieve the @try body.
VarDecl * getExceptionDecl() const
A reference to a declared variable, function, enum, etc. [C99 6.5.1p2].
Expr * getChunkSize()
Get chunk size.
static void PrintTemplateArgumentList(raw_ostream &OS, const TemplateArgument *Args, unsigned NumArgs, const PrintingPolicy &Policy, bool SkipBrackets=false)
Print a template argument list, including the '<' and '>' enclosing the template arguments...
const Expr * getInit(unsigned Init) const
const Expr * getSubExpr() const
bool hasTemplateKeyword() const
Determines whether the name was preceded by the template keyword.
ExprIterator arg_iterator
BinaryOperatorKind getOperator() const
unsigned getNumClobbers() const
static StringRef getOpcodeStr(Opcode Op)
This represents '#pragma omp taskyield' directive.
A boolean literal, per ([C++ lex.bool] Boolean literals).
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
QualType getDestroyedType() const
Retrieve the type being destroyed.
CompoundStmt * getTryBlock() const
This represents '#pragma omp parallel sections' directive.
bool isSignedIntegerType() const
const CallExpr * getConfig() const
bool isNull() const
isNull - Return true if this QualType doesn't point to a type yet.
bool isTypeOperand() const
The receiver is a superclass.
const char * getName() const
Stmt * getAssociatedStmt() const
Returns statement associated with the directive.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Represents Objective-C's @autoreleasepool Statement.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
Expr * getOrderFail() const
Represents an implicitly-generated value initialization of an object of a given type.
unsigned getNumElements() const
Attr - This represents one attribute.
operator "" X (unsigned long long)
Expr * getCookedLiteral()
If this is not a raw user-defined literal, get the underlying cooked literal (representing the litera...
SEHFinallyStmt * getFinallyHandler() const
QualType getArgumentType() const