;
68 classStmtPrinter :
public StmtVisitor<StmtPrinter> {
79StringRef NL =
"\n",
const ASTContext*Context =
nullptr)
80: OS(os), IndentLevel(Indentation), Helper(helper), Policy(Policy),
81NL(NL), Context(Context) {}
85 voidPrintStmt(
Stmt*S,
intSubIndent) {
86IndentLevel += SubIndent;
87 if(isa_and_nonnull<Expr>(S)) {
95Indent() <<
"<<<NULL STATEMENT>>>"<< NL;
97IndentLevel -= SubIndent;
100 voidPrintInitStmt(
Stmt*S,
unsignedPrefixWidth) {
102IndentLevel += (PrefixWidth + 1) / 2;
103 if(
auto*DS = dyn_cast<DeclStmt>(S))
104PrintRawDeclStmt(DS);
106PrintExpr(cast<Expr>(S));
108IndentLevel -= (PrefixWidth + 1) / 2;
111 voidPrintControlledStmt(
Stmt*S) {
112 if(
auto*CS = dyn_cast<CompoundStmt>(S)) {
114PrintRawCompoundStmt(CS);
123 voidPrintRawDecl(
Decl*
D);
124 voidPrintRawDeclStmt(
const DeclStmt*S);
131 boolForceNoStmt =
false);
136 voidPrintExpr(
Expr*
E) {
140OS <<
"<null expr>";
143raw_ostream &Indent(
intDelta = 0) {
144 for(
inti = 0, e = IndentLevel+Delta; i < e; ++i)
155 voidVisitStmt(
Stmt*
Node) LLVM_ATTRIBUTE_UNUSED {
156Indent() <<
"<<unknown stmt type>>"<< NL;
159 voidVisitExpr(
Expr*
Node) LLVM_ATTRIBUTE_UNUSED {
160OS <<
"<<unknown expr type>>";
165#define ABSTRACT_STMT(CLASS) 166#define STMT(CLASS, PARENT) \ 167 void Visit##CLASS(CLASS *Node); 168#include "clang/AST/StmtNodes.inc" 180assert(
Node&&
"Compound statement cannot be null");
182PrintFPPragmas(
Node);
183 for(
auto*I :
Node->body())
190 if(!S->hasStoredFPFeatures())
193 boolFEnvAccess =
false;
194 if(FPO.hasAllowFEnvAccessOverride()) {
195FEnvAccess = FPO.getAllowFEnvAccessOverride();
196Indent() <<
"#pragma STDC FENV_ACCESS "<< (FEnvAccess ?
"ON":
"OFF")
199 if(FPO.hasSpecifiedExceptionModeOverride()) {
201FPO.getSpecifiedExceptionModeOverride();
202 if(!FEnvAccess || EM != LangOptions::FPE_Strict) {
203Indent() <<
"#pragma clang fp exceptions(";
204 switch(FPO.getSpecifiedExceptionModeOverride()) {
207 caseLangOptions::FPE_Ignore:
210 caseLangOptions::FPE_MayTrap:
213 caseLangOptions::FPE_Strict:
220 if(FPO.hasConstRoundingModeOverride()) {
222Indent() <<
"#pragma STDC FENV_ROUND ";
224 casellvm::RoundingMode::TowardZero:
225OS <<
"FE_TOWARDZERO";
227 casellvm::RoundingMode::NearestTiesToEven:
228OS <<
"FE_TONEAREST";
230 casellvm::RoundingMode::TowardPositive:
233 casellvm::RoundingMode::TowardNegative:
234OS <<
"FE_DOWNWARD";
236 casellvm::RoundingMode::NearestTiesToAway:
237OS <<
"FE_TONEARESTFROMZERO";
239 casellvm::RoundingMode::Dynamic:
243llvm_unreachable(
"Invalid rounding mode");
249voidStmtPrinter::PrintRawDecl(
Decl*
D) {
250 D->
print(OS, Policy, IndentLevel);
253voidStmtPrinter::PrintRawDeclStmt(
const DeclStmt*S) {
259Indent() <<
";"<< NL;
264PrintRawDeclStmt(
Node);
270PrintRawCompoundStmt(
Node);
275Indent(-1) <<
"case ";
276PrintExpr(
Node->getLHS());
277 if(
Node->getRHS()) {
279PrintExpr(
Node->getRHS());
283PrintStmt(
Node->getSubStmt(), 0);
287Indent(-1) <<
"default:"<< NL;
288PrintStmt(
Node->getSubStmt(), 0);
292Indent(-1) <<
Node->getName() <<
":"<< NL;
293PrintStmt(
Node->getSubStmt(), 0);
298 for(
const auto*
Attr: Attrs) {
300 if(
Attr!= Attrs.back())
304PrintStmt(
Node->getSubStmt(), 0);
307voidStmtPrinter::PrintRawIfStmt(
IfStmt*
If) {
308 if(
If->isConsteval()) {
310 if(
If->isNegatedConsteval())
314PrintStmt(
If->getThen());
315 if(
Stmt*Else =
If->getElse()) {
326PrintInitStmt(
If->getInit(), 4);
327 if(
const DeclStmt*DS =
If->getConditionVariableDeclStmt())
328PrintRawDeclStmt(DS);
330PrintExpr(
If->getCond());
333 if(
auto*CS = dyn_cast<CompoundStmt>(
If->getThen())) {
335PrintRawCompoundStmt(CS);
336OS << (
If->getElse() ?
" ": NL);
339PrintStmt(
If->getThen());
340 if(
If->getElse()) Indent();
343 if(
Stmt*Else =
If->getElse()) {
346 if(
auto*CS = dyn_cast<CompoundStmt>(Else)) {
348PrintRawCompoundStmt(CS);
350}
else if(
auto*ElseIf = dyn_cast<IfStmt>(Else)) {
352PrintRawIfStmt(ElseIf);
355PrintStmt(
If->getElse());
360voidStmtPrinter::VisitIfStmt(
IfStmt*
If) {
362PrintRawIfStmt(
If);
366Indent() <<
"switch (";
367 if(
Node->getInit())
368PrintInitStmt(
Node->getInit(), 8);
369 if(
const DeclStmt*DS =
Node->getConditionVariableDeclStmt())
370PrintRawDeclStmt(DS);
372PrintExpr(
Node->getCond());
374PrintControlledStmt(
Node->getBody());
378Indent() <<
"while (";
379 if(
const DeclStmt*DS =
Node->getConditionVariableDeclStmt())
380PrintRawDeclStmt(DS);
382PrintExpr(
Node->getCond());
384PrintStmt(
Node->getBody());
387voidStmtPrinter::VisitDoStmt(
DoStmt*
Node) {
389 if(
auto*CS = dyn_cast<CompoundStmt>(
Node->getBody())) {
390PrintRawCompoundStmt(CS);
394PrintStmt(
Node->getBody());
399PrintExpr(
Node->getCond());
404Indent() <<
"for (";
405 if(
Node->getInit())
406PrintInitStmt(
Node->getInit(), 5);
408OS << (
Node->getCond() ?
"; ":
";");
409 if(
const DeclStmt*DS =
Node->getConditionVariableDeclStmt())
410PrintRawDeclStmt(DS);
411 else if(
Node->getCond())
412PrintExpr(
Node->getCond());
414 if(
Node->getInc()) {
416PrintExpr(
Node->getInc());
419PrintControlledStmt(
Node->getBody());
423Indent() <<
"for (";
424 if(
auto*DS = dyn_cast<DeclStmt>(
Node->getElement()))
425PrintRawDeclStmt(DS);
427PrintExpr(cast<Expr>(
Node->getElement()));
429PrintExpr(
Node->getCollection());
431PrintControlledStmt(
Node->getBody());
435Indent() <<
"for (";
436 if(
Node->getInit())
437PrintInitStmt(
Node->getInit(), 5);
439SubPolicy.SuppressInitializers =
true;
440 Node->getLoopVariable()->
print(OS, SubPolicy, IndentLevel);
442PrintExpr(
Node->getRangeInit());
444PrintControlledStmt(
Node->getBody());
449 if(
Node->isIfExists())
450OS <<
"__if_exists (";
452OS <<
"__if_not_exists (";
455=
Node->getQualifierLoc().getNestedNameSpecifier())
458OS <<
Node->getNameInfo() <<
") ";
460PrintRawCompoundStmt(
Node->getSubStmt());
464Indent() <<
"goto "<<
Node->getLabel()->getName() <<
";";
469Indent() <<
"goto *";
470PrintExpr(
Node->getTarget());
476Indent() <<
"continue;";
481Indent() <<
"break;";
486Indent() <<
"return";
487 if(
Node->getRetValue()) {
489PrintExpr(
Node->getRetValue());
498 if(
Node->isVolatile())
501 if(
Node->isAsmGoto())
505VisitStringLiteral(
Node->getAsmString());
508 if(
Node->getNumOutputs() != 0 ||
Node->getNumInputs() != 0 ||
509 Node->getNumClobbers() != 0 ||
Node->getNumLabels() != 0)
512 for(
unsignedi = 0, e =
Node->getNumOutputs(); i != e; ++i) {
516 if(!
Node->getOutputName(i).empty()) {
518OS <<
Node->getOutputName(i);
522VisitStringLiteral(
Node->getOutputConstraintLiteral(i));
524Visit(
Node->getOutputExpr(i));
529 if(
Node->getNumInputs() != 0 ||
Node->getNumClobbers() != 0 ||
530 Node->getNumLabels() != 0)
533 for(
unsignedi = 0, e =
Node->getNumInputs(); i != e; ++i) {
537 if(!
Node->getInputName(i).empty()) {
539OS <<
Node->getInputName(i);
543VisitStringLiteral(
Node->getInputConstraintLiteral(i));
545Visit(
Node->getInputExpr(i));
550 if(
Node->getNumClobbers() != 0 ||
Node->getNumLabels())
553 for(
unsignedi = 0, e =
Node->getNumClobbers(); i != e; ++i) {
557VisitStringLiteral(
Node->getClobberStringLiteral(i));
561 if(
Node->getNumLabels() != 0)
564 for(
unsignedi = 0, e =
Node->getNumLabels(); i != e; ++i) {
567OS <<
Node->getLabelName(i);
576Indent() <<
"__asm ";
577 if(
Node->hasBraces())
579OS <<
Node->getAsmString() << NL;
580 if(
Node->hasBraces())
581Indent() <<
"}"<< NL;
585PrintStmt(
Node->getCapturedDecl()->getBody());
589PrintStmt(
Node->getOutlinedFunctionDecl()->getBody());
594 if(
auto*TS = dyn_cast<CompoundStmt>(
Node->getTryBody())) {
595PrintRawCompoundStmt(TS);
600Indent() <<
"@catch(";
601 if(
Decl*DS = catchStmt->getCatchParamDecl())
604 if(
auto*CS = dyn_cast<CompoundStmt>(catchStmt->getCatchBody())) {
605PrintRawCompoundStmt(CS);
611Indent() <<
"@finally";
612 if(
auto*CS = dyn_cast<CompoundStmt>(FS->getFinallyBody())) {
613PrintRawCompoundStmt(CS);
623Indent() <<
"@catch (...) { /* todo */ } "<< NL;
627Indent() <<
"@throw";
628 if(
Node->getThrowExpr()) {
630PrintExpr(
Node->getThrowExpr());
635voidStmtPrinter::VisitObjCAvailabilityCheckExpr(
637OS <<
"@available(...)";
641Indent() <<
"@synchronized (";
642PrintExpr(
Node->getSynchExpr());
644PrintRawCompoundStmt(
Node->getSynchBody());
649Indent() <<
"@autoreleasepool";
650PrintRawCompoundStmt(cast<CompoundStmt>(
Node->getSubStmt()));
656 if(
Decl*ExDecl =
Node->getExceptionDecl())
657PrintRawDecl(ExDecl);
661PrintRawCompoundStmt(cast<CompoundStmt>(
Node->getHandlerBlock()));
666PrintRawCXXCatchStmt(
Node);
672PrintRawCompoundStmt(
Node->getTryBlock());
673 for(
unsignedi = 0, e =
Node->getNumHandlers(); i < e; ++i) {
675PrintRawCXXCatchStmt(
Node->getHandler(i));
681Indent() << (
Node->getIsCXXTry() ?
"try ":
"__try ");
682PrintRawCompoundStmt(
Node->getTryBlock());
686PrintRawSEHExceptHandler(
E);
688assert(F &&
"Must have a finally block...");
689PrintRawSEHFinallyStmt(F);
696PrintRawCompoundStmt(
Node->getBlock());
702VisitExpr(
Node->getFilterExpr());
704PrintRawCompoundStmt(
Node->getBlock());
710PrintRawSEHExceptHandler(
Node);
716PrintRawSEHFinallyStmt(
Node);
721Indent() <<
"__leave;";
730PrintStmt(
Node->getLoopStmt());
737 for(
auto*Clause : Clauses)
738 if(Clause && !Clause->isImplicit()) {
740Printer.Visit(Clause);
743 if(!ForceNoStmt && S->hasAssociatedStmt())
744PrintStmt(S->getRawStmt());
748Indent() <<
"#pragma omp metadirective";
749PrintOMPExecutableDirective(
Node);
753Indent() <<
"#pragma omp parallel";
754PrintOMPExecutableDirective(
Node);
758Indent() <<
"#pragma omp simd";
759PrintOMPExecutableDirective(
Node);
763Indent() <<
"#pragma omp tile";
764PrintOMPExecutableDirective(
Node);
768Indent() <<
"#pragma omp unroll";
769PrintOMPExecutableDirective(
Node);
773Indent() <<
"#pragma omp reverse";
774PrintOMPExecutableDirective(
Node);
778Indent() <<
"#pragma omp interchange";
779PrintOMPExecutableDirective(
Node);
783Indent() <<
"#pragma omp for";
784PrintOMPExecutableDirective(
Node);
788Indent() <<
"#pragma omp for simd";
789PrintOMPExecutableDirective(
Node);
793Indent() <<
"#pragma omp sections";
794PrintOMPExecutableDirective(
Node);
798Indent() <<
"#pragma omp section";
799PrintOMPExecutableDirective(
Node);
803Indent() <<
"#pragma omp scope";
804PrintOMPExecutableDirective(
Node);
808Indent() <<
"#pragma omp single";
809PrintOMPExecutableDirective(
Node);
813Indent() <<
"#pragma omp master";
814PrintOMPExecutableDirective(
Node);
818Indent() <<
"#pragma omp critical";
819 if(
Node->getDirectiveName().getName()) {
821 Node->getDirectiveName().printName(OS, Policy);
824PrintOMPExecutableDirective(
Node);
828Indent() <<
"#pragma omp parallel for";
829PrintOMPExecutableDirective(
Node);
832voidStmtPrinter::VisitOMPParallelForSimdDirective(
834Indent() <<
"#pragma omp parallel for simd";
835PrintOMPExecutableDirective(
Node);
838voidStmtPrinter::VisitOMPParallelMasterDirective(
840Indent() <<
"#pragma omp parallel master";
841PrintOMPExecutableDirective(
Node);
844voidStmtPrinter::VisitOMPParallelMaskedDirective(
846Indent() <<
"#pragma omp parallel masked";
847PrintOMPExecutableDirective(
Node);
850voidStmtPrinter::VisitOMPParallelSectionsDirective(
852Indent() <<
"#pragma omp parallel sections";
853PrintOMPExecutableDirective(
Node);
857Indent() <<
"#pragma omp task";
858PrintOMPExecutableDirective(
Node);
862Indent() <<
"#pragma omp taskyield";
863PrintOMPExecutableDirective(
Node);
867Indent() <<
"#pragma omp barrier";
868PrintOMPExecutableDirective(
Node);
872Indent() <<
"#pragma omp taskwait";
873PrintOMPExecutableDirective(
Node);
877Indent() <<
"#pragma omp assume";
878PrintOMPExecutableDirective(
Node);
882Indent() <<
"#pragma omp error";
883PrintOMPExecutableDirective(
Node);
887Indent() <<
"#pragma omp taskgroup";
888PrintOMPExecutableDirective(
Node);
892Indent() <<
"#pragma omp flush";
893PrintOMPExecutableDirective(
Node);
897Indent() <<
"#pragma omp depobj";
898PrintOMPExecutableDirective(
Node);
902Indent() <<
"#pragma omp scan";
903PrintOMPExecutableDirective(
Node);
907Indent() <<
"#pragma omp ordered";
912Indent() <<
"#pragma omp atomic";
913PrintOMPExecutableDirective(
Node);
917Indent() <<
"#pragma omp target";
918PrintOMPExecutableDirective(
Node);
922Indent() <<
"#pragma omp target data";
923PrintOMPExecutableDirective(
Node);
926voidStmtPrinter::VisitOMPTargetEnterDataDirective(
928Indent() <<
"#pragma omp target enter data";
929PrintOMPExecutableDirective(
Node,
true);
932voidStmtPrinter::VisitOMPTargetExitDataDirective(
934Indent() <<
"#pragma omp target exit data";
935PrintOMPExecutableDirective(
Node,
true);
938voidStmtPrinter::VisitOMPTargetParallelDirective(
940Indent() <<
"#pragma omp target parallel";
941PrintOMPExecutableDirective(
Node);
944voidStmtPrinter::VisitOMPTargetParallelForDirective(
946Indent() <<
"#pragma omp target parallel for";
947PrintOMPExecutableDirective(
Node);
951Indent() <<
"#pragma omp teams";
952PrintOMPExecutableDirective(
Node);
955voidStmtPrinter::VisitOMPCancellationPointDirective(
957Indent() <<
"#pragma omp cancellation point " 958<< getOpenMPDirectiveName(
Node->getCancelRegion());
959PrintOMPExecutableDirective(
Node);
963Indent() <<
"#pragma omp cancel " 964<< getOpenMPDirectiveName(
Node->getCancelRegion());
965PrintOMPExecutableDirective(
Node);
969Indent() <<
"#pragma omp taskloop";
970PrintOMPExecutableDirective(
Node);
973voidStmtPrinter::VisitOMPTaskLoopSimdDirective(
975Indent() <<
"#pragma omp taskloop simd";
976PrintOMPExecutableDirective(
Node);
979voidStmtPrinter::VisitOMPMasterTaskLoopDirective(
981Indent() <<
"#pragma omp master taskloop";
982PrintOMPExecutableDirective(
Node);
985voidStmtPrinter::VisitOMPMaskedTaskLoopDirective(
987Indent() <<
"#pragma omp masked taskloop";
988PrintOMPExecutableDirective(
Node);
991voidStmtPrinter::VisitOMPMasterTaskLoopSimdDirective(
993Indent() <<
"#pragma omp master taskloop simd";
994PrintOMPExecutableDirective(
Node);
997voidStmtPrinter::VisitOMPMaskedTaskLoopSimdDirective(
999Indent() <<
"#pragma omp masked taskloop simd";
1000PrintOMPExecutableDirective(
Node);
1003voidStmtPrinter::VisitOMPParallelMasterTaskLoopDirective(
1005Indent() <<
"#pragma omp parallel master taskloop";
1006PrintOMPExecutableDirective(
Node);
1009voidStmtPrinter::VisitOMPParallelMaskedTaskLoopDirective(
1011Indent() <<
"#pragma omp parallel masked taskloop";
1012PrintOMPExecutableDirective(
Node);
1015voidStmtPrinter::VisitOMPParallelMasterTaskLoopSimdDirective(
1017Indent() <<
"#pragma omp parallel master taskloop simd";
1018PrintOMPExecutableDirective(
Node);
1021voidStmtPrinter::VisitOMPParallelMaskedTaskLoopSimdDirective(
1023Indent() <<
"#pragma omp parallel masked taskloop simd";
1024PrintOMPExecutableDirective(
Node);
1028Indent() <<
"#pragma omp distribute";
1029PrintOMPExecutableDirective(
Node);
1032voidStmtPrinter::VisitOMPTargetUpdateDirective(
1034Indent() <<
"#pragma omp target update";
1035PrintOMPExecutableDirective(
Node,
true);
1038voidStmtPrinter::VisitOMPDistributeParallelForDirective(
1040Indent() <<
"#pragma omp distribute parallel for";
1041PrintOMPExecutableDirective(
Node);
1044voidStmtPrinter::VisitOMPDistributeParallelForSimdDirective(
1046Indent() <<
"#pragma omp distribute parallel for simd";
1047PrintOMPExecutableDirective(
Node);
1050voidStmtPrinter::VisitOMPDistributeSimdDirective(
1052Indent() <<
"#pragma omp distribute simd";
1053PrintOMPExecutableDirective(
Node);
1056voidStmtPrinter::VisitOMPTargetParallelForSimdDirective(
1058Indent() <<
"#pragma omp target parallel for simd";
1059PrintOMPExecutableDirective(
Node);
1063Indent() <<
"#pragma omp target simd";
1064PrintOMPExecutableDirective(
Node);
1067voidStmtPrinter::VisitOMPTeamsDistributeDirective(
1069Indent() <<
"#pragma omp teams distribute";
1070PrintOMPExecutableDirective(
Node);
1073voidStmtPrinter::VisitOMPTeamsDistributeSimdDirective(
1075Indent() <<
"#pragma omp teams distribute simd";
1076PrintOMPExecutableDirective(
Node);
1079voidStmtPrinter::VisitOMPTeamsDistributeParallelForSimdDirective(
1081Indent() <<
"#pragma omp teams distribute parallel for simd";
1082PrintOMPExecutableDirective(
Node);
1085voidStmtPrinter::VisitOMPTeamsDistributeParallelForDirective(
1087Indent() <<
"#pragma omp teams distribute parallel for";
1088PrintOMPExecutableDirective(
Node);
1092Indent() <<
"#pragma omp target teams";
1093PrintOMPExecutableDirective(
Node);
1096voidStmtPrinter::VisitOMPTargetTeamsDistributeDirective(
1098Indent() <<
"#pragma omp target teams distribute";
1099PrintOMPExecutableDirective(
Node);
1102voidStmtPrinter::VisitOMPTargetTeamsDistributeParallelForDirective(
1104Indent() <<
"#pragma omp target teams distribute parallel for";
1105PrintOMPExecutableDirective(
Node);
1108voidStmtPrinter::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
1110Indent() <<
"#pragma omp target teams distribute parallel for simd";
1111PrintOMPExecutableDirective(
Node);
1114voidStmtPrinter::VisitOMPTargetTeamsDistributeSimdDirective(
1116Indent() <<
"#pragma omp target teams distribute simd";
1117PrintOMPExecutableDirective(
Node);
1121Indent() <<
"#pragma omp interop";
1122PrintOMPExecutableDirective(
Node);
1126Indent() <<
"#pragma omp dispatch";
1127PrintOMPExecutableDirective(
Node);
1131Indent() <<
"#pragma omp masked";
1132PrintOMPExecutableDirective(
Node);
1136Indent() <<
"#pragma omp loop";
1137PrintOMPExecutableDirective(
Node);
1140voidStmtPrinter::VisitOMPTeamsGenericLoopDirective(
1142Indent() <<
"#pragma omp teams loop";
1143PrintOMPExecutableDirective(
Node);
1146voidStmtPrinter::VisitOMPTargetTeamsGenericLoopDirective(
1148Indent() <<
"#pragma omp target teams loop";
1149PrintOMPExecutableDirective(
Node);
1152voidStmtPrinter::VisitOMPParallelGenericLoopDirective(
1154Indent() <<
"#pragma omp parallel loop";
1155PrintOMPExecutableDirective(
Node);
1158voidStmtPrinter::VisitOMPTargetParallelGenericLoopDirective(
1160Indent() <<
"#pragma omp target parallel loop";
1161PrintOMPExecutableDirective(
Node);
1168 if(!S->clauses().empty()) {
1171Printer.VisitClauseList(S->clauses());
1175Indent() <<
"#pragma acc "<< S->getDirectiveKind();
1176PrintOpenACCClauseList(S);
1180PrintOpenACCConstruct(S);
1181PrintStmt(S->getStructuredBlock());
1185PrintOpenACCConstruct(S);
1186PrintStmt(S->getLoop());
1190PrintOpenACCConstruct(S);
1191PrintStmt(S->getLoop());
1195PrintOpenACCConstruct(S);
1196PrintStmt(S->getStructuredBlock());
1199PrintOpenACCConstruct(S);
1200PrintStmt(S->getStructuredBlock());
1203PrintOpenACCConstruct(S);
1206PrintOpenACCConstruct(S);
1209PrintOpenACCConstruct(S);
1212PrintOpenACCConstruct(S);
1215PrintOpenACCConstruct(S);
1218PrintOpenACCConstruct(S);
1222Indent() <<
"#pragma acc wait";
1223 if(!S->getLParenLoc().isInvalid()) {
1225 if(S->hasDevNumExpr()) {
1227S->getDevNumExpr()->printPretty(OS,
nullptr, Policy);
1231 if(S->hasQueuesTag())
1234llvm::interleaveComma(S->getQueueIdExprs(), OS, [&](
const Expr*
E) {
1235E->printPretty(OS, nullptr, Policy);
1241PrintOpenACCClauseList(S);
1250OS <<
Node->getBuiltinStr() <<
"()";
1254llvm::report_fatal_error(
"Not implemented");
1258PrintExpr(
Node->getSubExpr());
1263 if(
const auto*OCED = dyn_cast<OMPCapturedExprDecl>(VD)) {
1264OCED->getInit()->IgnoreImpCasts()->printPretty(OS,
nullptr, Policy);
1267 if(
const auto*TPOD = dyn_cast<TemplateParamObjectDecl>(VD)) {
1268TPOD->printAsExpr(OS, Policy);
1273 if(
Node->hasTemplateKeyword())
1279isa<ParmVarDecl, NonTypeTemplateParmDecl>(VD) && ID)
1280OS <<
ID->deuglifiedName();
1285 caseDecl::NonTypeTemplateParm: {
1286 auto*TD = cast<NonTypeTemplateParmDecl>(VD);
1287OS <<
"value-parameter-"<< TD->getDepth() <<
'-'<< TD->getIndex() <<
"";
1290 caseDecl::ParmVar: {
1291 auto*PD = cast<ParmVarDecl>(VD);
1292OS <<
"function-parameter-"<< PD->getFunctionScopeDepth() <<
'-' 1293<< PD->getFunctionScopeIndex();
1296 caseDecl::Decomposition:
1297OS <<
"decomposition";
1298 for(
const auto&I : cast<DecompositionDecl>(VD)->bindings())
1299OS <<
'-'<< I->getName();
1306 if(
Node->hasExplicitTemplateArgs()) {
1308 if(!
Node->hadMultipleCandidates())
1309 if(
auto*TD = dyn_cast<TemplateDecl>(VD))
1310TPL = TD->getTemplateParameters();
1315voidStmtPrinter::VisitDependentScopeDeclRefExpr(
1319 if(
Node->hasTemplateKeyword())
1321OS <<
Node->getNameInfo();
1322 if(
Node->hasExplicitTemplateArgs())
1327 if(
Node->getQualifier())
1328 Node->getQualifier()->
print(OS, Policy);
1329 if(
Node->hasTemplateKeyword())
1331OS <<
Node->getNameInfo();
1332 if(
Node->hasExplicitTemplateArgs())
1337 if(
const auto*DRE = dyn_cast<DeclRefExpr>(
E)) {
1338 if(
const auto*PD = dyn_cast<ImplicitParamDecl>(DRE->getDecl())) {
1339 if(PD->getParameterKind() == ImplicitParamKind::ObjCSelf &&
1340DRE->getBeginLoc().isInvalid())
1348 if(
Node->getBase()) {
1351PrintExpr(
Node->getBase());
1352OS << (
Node->isArrow() ?
"->":
".");
1355OS << *
Node->getDecl();
1359 if(
Node->isSuperReceiver())
1361 else if(
Node->isObjectReceiver() &&
Node->getBase()) {
1362PrintExpr(
Node->getBase());
1364}
else if(
Node->isClassReceiver() &&
Node->getClassReceiver()) {
1365OS <<
Node->getClassReceiver()->getName() <<
".";
1368 if(
Node->isImplicitProperty()) {
1369 if(
const auto*Getter =
Node->getImplicitPropertyGetter())
1370Getter->getSelector().
print(OS);
1373 Node->getImplicitPropertySetter()->getSelector());
1375OS <<
Node->getExplicitProperty()->getName();
1379PrintExpr(
Node->getBaseExpr());
1381PrintExpr(
Node->getKeyExpr());
1385voidStmtPrinter::VisitSYCLUniqueStableNameExpr(
1387OS <<
"__builtin_sycl_unique_stable_name(";
1388 Node->getTypeSourceInfo()->getType().
print(OS, Policy);
1424 boolisSigned =
Node->getType()->isSignedIntegerType();
1427 if(isa<BitIntType>(
Node->getType())) {
1428OS << (isSigned ?
"wb":
"uwb");
1434 default: llvm_unreachable(
"Unexpected type for integer literal!");
1435 caseBuiltinType::Char_S:
1436 caseBuiltinType::Char_U: OS <<
"i8";
break;
1437 caseBuiltinType::UChar: OS <<
"Ui8";
break;
1438 caseBuiltinType::SChar: OS <<
"i8";
break;
1439 caseBuiltinType::Short: OS <<
"i16";
break;
1440 caseBuiltinType::UShort: OS <<
"Ui16";
break;
1441 caseBuiltinType::Int:
break;
1442 caseBuiltinType::UInt: OS <<
'U';
break;
1443 caseBuiltinType::Long: OS <<
'L';
break;
1444 caseBuiltinType::ULong: OS <<
"UL";
break;
1445 caseBuiltinType::LongLong: OS <<
"LL";
break;
1446 caseBuiltinType::ULongLong: OS <<
"ULL";
break;
1447 caseBuiltinType::Int128:
1449 caseBuiltinType::UInt128:
1451 caseBuiltinType::WChar_S:
1452 caseBuiltinType::WChar_U:
1460OS <<
Node->getValueAsString(
10);
1463 default: llvm_unreachable(
"Unexpected type for fixed point literal!");
1464 caseBuiltinType::ShortFract: OS <<
"hr";
break;
1465 caseBuiltinType::ShortAccum: OS <<
"hk";
break;
1466 caseBuiltinType::UShortFract: OS <<
"uhr";
break;
1467 caseBuiltinType::UShortAccum: OS <<
"uhk";
break;
1468 caseBuiltinType::Fract: OS <<
"r";
break;
1469 caseBuiltinType::Accum: OS <<
"k";
break;
1470 caseBuiltinType::UFract: OS <<
"ur";
break;
1471 caseBuiltinType::UAccum: OS <<
"uk";
break;
1472 caseBuiltinType::LongFract: OS <<
"lr";
break;
1473 caseBuiltinType::LongAccum: OS <<
"lk";
break;
1474 caseBuiltinType::ULongFract: OS <<
"ulr";
break;
1475 caseBuiltinType::ULongAccum: OS <<
"ulk";
break;
1482 Node->getValue().toString(Str);
1484 if(Str.find_first_not_of(
"-0123456789") == StringRef::npos)
1492 default: llvm_unreachable(
"Unexpected type for float literal!");
1493 caseBuiltinType::Half:
break;
1494 caseBuiltinType::Ibm128:
break;
1495 caseBuiltinType::Double:
break;
1496 caseBuiltinType::Float16: OS <<
"F16";
break;
1497 caseBuiltinType::Float: OS <<
'F';
break;
1498 caseBuiltinType::LongDouble: OS <<
'L';
break;
1499 caseBuiltinType::Float128: OS <<
'Q';
break;
1510PrintExpr(
Node->getSubExpr());
1520PrintExpr(
Node->getSubExpr());
1525 if(!
Node->isPostfix()) {
1530 switch(
Node->getOpcode()) {
1539 if(isa<UnaryOperator>(
Node->getSubExpr()))
1544PrintExpr(
Node->getSubExpr());
1546 if(
Node->isPostfix())
1551OS <<
"__builtin_offsetof(";
1552 Node->getTypeSourceInfo()->getType().
print(OS, Policy);
1554 boolPrintedSomething =
false;
1555 for(
unsignedi = 0, n =
Node->getNumComponents(); i < n; ++i) {
1562PrintedSomething =
true;
1575 if(PrintedSomething)
1578PrintedSomething =
true;
1579OS <<
Id->getName();
1584voidStmtPrinter::VisitUnaryExprOrTypeTraitExpr(
1587 if(
Node->getKind() == UETT_AlignOf) {
1589Spelling =
"alignof";
1591Spelling =
"_Alignof";
1593Spelling =
"__alignof";
1598 if(
Node->isArgumentType()) {
1600 Node->getArgumentType().
print(OS, Policy);
1604PrintExpr(
Node->getArgumentExpr());
1610 if(
Node->isExprPredicate())
1611PrintExpr(
Node->getControllingExpr());
1613 Node->getControllingType()->getType().
print(OS, Policy);
1621 T.print(OS, Policy);
1623PrintExpr(Assoc.getAssociationExpr());
1629PrintExpr(
Node->getLHS());
1631PrintExpr(
Node->getRHS());
1636PrintExpr(
Node->getBase());
1638PrintExpr(
Node->getRowIdx());
1641PrintExpr(
Node->getColumnIdx());
1646PrintExpr(
Node->getBase());
1648 if(
Node->getLowerBound())
1649PrintExpr(
Node->getLowerBound());
1650 if(
Node->getColonLocFirst().isValid()) {
1652 if(
Node->getLength())
1653PrintExpr(
Node->getLength());
1655 if(
Node->isOMPArraySection() &&
Node->getColonLocSecond().isValid()) {
1657 if(
Node->getStride())
1658PrintExpr(
Node->getStride());
1665 for(
Expr*
E:
Node->getDimensions()) {
1671PrintExpr(
Node->getBase());
1676 for(
unsignedI = 0,
E=
Node->numOfIterators(); I <
E; ++I) {
1677 auto*VD = cast<ValueDecl>(
Node->getIteratorDecl(I));
1680OS <<
" "<< VD->
getName() <<
" = ";
1681PrintExpr(
Range.Begin);
1683PrintExpr(
Range.End);
1686PrintExpr(
Range.Step);
1695 for(
unsignedi = 0, e =
Call->getNumArgs(); i != e; ++i) {
1696 if(isa<CXXDefaultArgExpr>(
Call->getArg(i))) {
1702PrintExpr(
Call->getArg(i));
1707PrintExpr(
Call->getCallee());
1709PrintCallArgs(
Call);
1714 if(
const auto*TE = dyn_cast<CXXThisExpr>(
E))
1715 returnTE->isImplicit();
1721PrintExpr(
Node->getBase());
1723 auto*ParentMember = dyn_cast<MemberExpr>(
Node->getBase());
1725ParentMember ? dyn_cast<FieldDecl>(ParentMember->getMemberDecl())
1729OS << (
Node->isArrow() ?
"->":
".");
1732 if(
auto*FD = dyn_cast<FieldDecl>(
Node->getMemberDecl()))
1733 if(FD->isAnonymousStructOrUnion())
1738 if(
Node->hasTemplateKeyword())
1740OS <<
Node->getMemberNameInfo();
1742 if(
auto*FD = dyn_cast<FunctionDecl>(
Node->getMemberDecl())) {
1743 if(!
Node->hadMultipleCandidates())
1744 if(
auto*FTD = FD->getPrimaryTemplate())
1745TPL = FTD->getTemplateParameters();
1746}
else if(
auto*VTSD =
1747dyn_cast<VarTemplateSpecializationDecl>(
Node->getMemberDecl()))
1748TPL = VTSD->getSpecializedTemplate()->getTemplateParameters();
1749 if(
Node->hasExplicitTemplateArgs())
1754PrintExpr(
Node->getBase());
1755OS << (
Node->isArrow() ?
"->isa":
".isa");
1759PrintExpr(
Node->getBase());
1761OS <<
Node->getAccessor().getName();
1766 Node->getTypeAsWritten().
print(OS, Policy);
1768PrintExpr(
Node->getSubExpr());
1775PrintExpr(
Node->getInitializer());
1780PrintExpr(
Node->getSubExpr());
1784PrintExpr(
Node->getLHS());
1786PrintExpr(
Node->getRHS());
1790PrintExpr(
Node->getLHS());
1792PrintExpr(
Node->getRHS());
1796PrintExpr(
Node->getCond());
1798PrintExpr(
Node->getLHS());
1800PrintExpr(
Node->getRHS());
1807PrintExpr(
Node->getCommon());
1809PrintExpr(
Node->getFalseExpr());
1813OS <<
"&&"<<
Node->getLabel()->getName();
1816voidStmtPrinter::VisitStmtExpr(
StmtExpr*
E) {
1818PrintRawCompoundStmt(
E->getSubStmt());
1823OS <<
"__builtin_choose_expr(";
1824PrintExpr(
Node->getCond());
1826PrintExpr(
Node->getLHS());
1828PrintExpr(
Node->getRHS());
1832voidStmtPrinter::VisitGNUNullExpr(
GNUNullExpr*) {
1837OS <<
"__builtin_shufflevector(";
1838 for(
unsignedi = 0, e =
Node->getNumSubExprs(); i != e; ++i) {
1840PrintExpr(
Node->getExpr(i));
1846OS <<
"__builtin_convertvector(";
1847PrintExpr(
Node->getSrcExpr());
1854 if(
Node->getSyntacticForm()) {
1855Visit(
Node->getSyntacticForm());
1860 for(
unsignedi = 0, e =
Node->getNumInits(); i != e; ++i) {
1862 if(
Node->getInit(i))
1863PrintExpr(
Node->getInit(i));
1874PrintExpr(
Node->getSubExpr());
1884 for(
unsignedi = 0, e =
Node->getNumExprs(); i != e; ++i) {
1886PrintExpr(
Node->getExpr(i));
1892 boolNeedsEquals =
true;
1894 if(
D.isFieldDesignator()) {
1895 if(
D.getDotLoc().isInvalid()) {
1897OS << II->getName() <<
":";
1898NeedsEquals =
false;
1901OS <<
"."<<
D.getFieldName()->getName();
1905 if(
D.isArrayDesignator()) {
1906PrintExpr(
Node->getArrayIndex(
D));
1908PrintExpr(
Node->getArrayRangeStart(
D));
1910PrintExpr(
Node->getArrayRangeEnd(
D));
1920PrintExpr(
Node->getInit());
1923voidStmtPrinter::VisitDesignatedInitUpdateExpr(
1927PrintExpr(
Node->getBase());
1930OS <<
"/*updater*/";
1931PrintExpr(
Node->getUpdater());
1936OS <<
"/*no init*/";
1940 if(
Node->getType()->getAsCXXRecordDecl()) {
1941OS <<
"/*implicit*/";
1945OS <<
"/*implicit*/(";
1948 if(
Node->getType()->isRecordType())
1956OS <<
"__builtin_va_arg(";
1957PrintExpr(
Node->getSubExpr());
1964PrintExpr(
Node->getSyntacticForm());
1968 const char*Name =
nullptr;
1969 switch(
Node->getOp()) {
1970#define BUILTIN(ID, TYPE, ATTRS) 1971#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) \ 1972 case AtomicExpr::AO ## ID: \ 1975#include "clang/Basic/Builtins.inc" 1980PrintExpr(
Node->getPtr());
1981 if(
Node->getOp() != AtomicExpr::AO__c11_atomic_load &&
1982 Node->getOp() != AtomicExpr::AO__atomic_load_n &&
1983 Node->getOp() != AtomicExpr::AO__scoped_atomic_load_n &&
1984 Node->getOp() != AtomicExpr::AO__opencl_atomic_load &&
1985 Node->getOp() != AtomicExpr::AO__hip_atomic_load) {
1987PrintExpr(
Node->getVal1());
1989 if(
Node->getOp() == AtomicExpr::AO__atomic_exchange ||
1990 Node->isCmpXChg()) {
1992PrintExpr(
Node->getVal2());
1994 if(
Node->getOp() == AtomicExpr::AO__atomic_compare_exchange ||
1995 Node->getOp() == AtomicExpr::AO__atomic_compare_exchange_n) {
1997PrintExpr(
Node->getWeak());
1999 if(
Node->getOp() != AtomicExpr::AO__c11_atomic_init &&
2000 Node->getOp() != AtomicExpr::AO__opencl_atomic_init) {
2002PrintExpr(
Node->getOrder());
2004 if(
Node->isCmpXChg()) {
2006PrintExpr(
Node->getOrderFail());
2014 if(Kind == OO_PlusPlus || Kind == OO_MinusMinus) {
2015 if(
Node->getNumArgs() == 1) {
2017PrintExpr(
Node->getArg(0));
2019PrintExpr(
Node->getArg(0));
2022}
else if(Kind == OO_Arrow) {
2023PrintExpr(
Node->getArg(0));
2024}
else if(Kind == OO_Call || Kind == OO_Subscript) {
2025PrintExpr(
Node->getArg(0));
2026OS << (
Kind== OO_Call ?
'(':
'[');
2027 for(
unsignedArgIdx = 1; ArgIdx <
Node->getNumArgs(); ++ArgIdx) {
2030 if(!isa<CXXDefaultArgExpr>(
Node->getArg(ArgIdx)))
2031PrintExpr(
Node->getArg(ArgIdx));
2033OS << (
Kind== OO_Call ?
')':
']');
2034}
else if(
Node->getNumArgs() == 1) {
2036PrintExpr(
Node->getArg(0));
2037}
else if(
Node->getNumArgs() == 2) {
2038PrintExpr(
Node->getArg(0));
2040PrintExpr(
Node->getArg(1));
2042llvm_unreachable(
"unknown overloaded operator");
2049 if(isa_and_nonnull<CXXConversionDecl>(MD)) {
2050PrintExpr(
Node->getImplicitObjectArgument());
2053VisitCallExpr(cast<CallExpr>(
Node));
2057PrintExpr(
Node->getCallee());
2059PrintCallArgs(
Node->getConfig());
2061PrintCallArgs(
Node);
2065voidStmtPrinter::VisitCXXRewrittenBinaryOperator(
2068 Node->getDecomposedForm();
2069PrintExpr(
const_cast<Expr*
>(Decomposed.
LHS));
2071PrintExpr(
const_cast<Expr*
>(Decomposed.
RHS));
2075OS <<
Node->getCastName() <<
'<';
2076 Node->getTypeAsWritten().
print(OS, Policy);
2078PrintExpr(
Node->getSubExpr());
2083VisitCXXNamedCastExpr(
Node);
2087VisitCXXNamedCastExpr(
Node);
2091VisitCXXNamedCastExpr(
Node);
2095VisitCXXNamedCastExpr(
Node);
2099OS <<
"__builtin_bit_cast(";
2100 Node->getTypeInfoAsWritten()->getType().
print(OS, Policy);
2102PrintExpr(
Node->getSubExpr());
2107VisitCXXNamedCastExpr(
Node);
2112 if(
Node->isTypeOperand()) {
2113 Node->getTypeOperandSourceInfo()->getType().
print(OS, Policy);
2115PrintExpr(
Node->getExprOperand());
2122 if(
Node->isTypeOperand()) {
2123 Node->getTypeOperandSourceInfo()->getType().
print(OS, Policy);
2125PrintExpr(
Node->getExprOperand());
2131PrintExpr(
Node->getBaseExpr());
2132 if(
Node->isArrow())
2137 Node->getQualifierLoc().getNestedNameSpecifier())
2139OS <<
Node->getPropertyDecl()->getDeclName();
2143PrintExpr(
Node->getBase());
2145PrintExpr(
Node->getIdx());
2150 switch(
Node->getLiteralOperatorKind()) {
2152OS << cast<StringLiteral>(
Node->getArg(0)->IgnoreImpCasts())->getString();
2155 const auto*DRE = cast<DeclRefExpr>(
Node->getCallee()->IgnoreImpCasts());
2157cast<FunctionDecl>(DRE->getDecl())->getTemplateSpecializationArgs();
2162 if(!DRE->hadMultipleCandidates())
2163 if(
const auto*TD = dyn_cast<TemplateDecl>(DRE->getDecl()))
2164TPL = TD->getTemplateParameters();
2165OS <<
"operator\"\""<<
Node->getUDSuffix()->getName();
2173 char C= (char)
P.getAsIntegral().getZExtValue();
2180 const auto*
Int= cast<IntegerLiteral>(
Node->getCookedLiteral());
2186 auto*
Float= cast<FloatingLiteral>(
Node->getCookedLiteral());
2192PrintExpr(
Node->getCookedLiteral());
2195OS <<
Node->getUDSuffix()->getName();
2199OS << (
Node->getValue() ?
"true":
"false");
2211 if(!
Node->getSubExpr())
2215PrintExpr(
Node->getSubExpr());
2228 autoTargetType =
Node->getType();
2229 auto*
Auto= TargetType->getContainedDeducedType();
2230 boolBare =
Auto&&
Auto->isDeduced();
2235TargetType.print(OS, Policy);
2240 if(!
Node->isListInitialization())
2242PrintExpr(
Node->getSubExpr());
2243 if(!
Node->isListInitialization())
2248PrintExpr(
Node->getSubExpr());
2253 if(
Node->isStdInitListInitialization())
2255 else if(
Node->isListInitialization())
2260ArgEnd =
Node->arg_end();
2261Arg != ArgEnd; ++Arg) {
2262 if((*Arg)->isDefaultArgument())
2264 if(Arg !=
Node->arg_begin())
2268 if(
Node->isStdInitListInitialization())
2270 else if(
Node->isListInitialization())
2278 boolNeedComma =
false;
2279 switch(
Node->getCaptureDefault()) {
2294CEnd =
Node->explicit_capture_end();
2297 if(
C->capturesVLAType())
2304 switch(
C->getCaptureKind()) {
2316OS <<
C->getCapturedVar()->getName();
2320OS <<
C->getCapturedVar()->getName();
2324llvm_unreachable(
"VLA type in explicit captures.");
2327 if(
C->isPackExpansion())
2330 if(
Node->isInitCapture(
C)) {
2332 auto*
D= cast<VarDecl>(
C->getCapturedVar());
2334llvm::StringRef
Pre;
2335llvm::StringRef
Post;
2337!isa<ParenListExpr>(
D->getInit())) {
2345PrintExpr(
D->getInit());
2351 if(!
Node->getExplicitTemplateParameters().empty()) {
2352 Node->getTemplateParameterList()->
print(
2353OS,
Node->getLambdaClass()->getASTContext(),
2357 if(
Node->hasExplicitParameters()) {
2367std::string ParamStr =
2369?
P->getIdentifier()->deuglifiedName().str()
2370:
P->getNameAsString();
2371 P->getOriginalType().print(OS, Policy, ParamStr);
2380 if(
Node->isMutable())
2389 if(
Node->hasExplicitResultType()) {
2391Proto->getReturnType().print(OS, Policy);
2400PrintRawCompoundStmt(
Node->getCompoundStmtBody());
2405TSInfo->getType().print(OS, Policy);
2411voidStmtPrinter::VisitCXXNewExpr(
CXXNewExpr*
E) {
2412 if(
E->isGlobalNew())
2415 unsignedNumPlace =
E->getNumPlacementArgs();
2416 if(NumPlace > 0 && !isa<CXXDefaultArgExpr>(
E->getPlacementArg(0))) {
2418PrintExpr(
E->getPlacementArg(0));
2419 for(
unsignedi = 1; i < NumPlace; ++i) {
2420 if(isa<CXXDefaultArgExpr>(
E->getPlacementArg(i)))
2423PrintExpr(
E->getPlacementArg(i));
2427 if(
E->isParenTypeId())
2430 if(
E->isArray()) {
2431llvm::raw_string_ostream
s(TypeS);
2433 if(std::optional<Expr *> Size =
E->getArraySize())
2434(*Size)->printPretty(
s, Helper, Policy);
2437 E->getAllocatedType().print(OS, Policy, TypeS);
2438 if(
E->isParenTypeId())
2442 if(InitStyle != CXXNewInitializationStyle::None) {
2443 boolBare = InitStyle == CXXNewInitializationStyle::Parens &&
2444!isa<ParenListExpr>(
E->getInitializer());
2447PrintExpr(
E->getInitializer());
2454 if(
E->isGlobalDelete())
2457 if(
E->isArrayForm())
2459PrintExpr(
E->getArgument());
2463PrintExpr(
E->getBase());
2468 if(
E->getQualifier())
2469 E->getQualifier()->print(OS, Policy);
2473OS << II->getName();
2475 E->getDestroyedType().print(OS, Policy);
2479 if(
E->isListInitialization() && !
E->isStdInitListInitialization())
2482 for(
unsignedi = 0, e =
E->getNumArgs(); i != e; ++i) {
2483 if(isa<CXXDefaultArgExpr>(
E->getArg(i))) {
2489PrintExpr(
E->getArg(i));
2492 if(
E->isListInitialization() && !
E->isStdInitListInitialization())
2498OS <<
"<forwarded>";
2502PrintExpr(
E->getSubExpr());
2507PrintExpr(
E->getSubExpr());
2510voidStmtPrinter::VisitCXXUnresolvedConstructExpr(
2512 Node->getTypeAsWritten().
print(OS, Policy);
2513 if(!
Node->isListInitialization())
2515 for(
autoArg =
Node->arg_begin(), ArgEnd =
Node->arg_end(); Arg != ArgEnd;
2517 if(Arg !=
Node->arg_begin())
2521 if(!
Node->isListInitialization())
2525voidStmtPrinter::VisitCXXDependentScopeMemberExpr(
2527 if(!
Node->isImplicitAccess()) {
2528PrintExpr(
Node->getBase());
2529OS << (
Node->isArrow() ?
"->":
".");
2533 if(
Node->hasTemplateKeyword())
2535OS <<
Node->getMemberNameInfo();
2536 if(
Node->hasExplicitTemplateArgs())
2541 if(!
Node->isImplicitAccess()) {
2542PrintExpr(
Node->getBase());
2543OS << (
Node->isArrow() ?
"->":
".");
2547 if(
Node->hasTemplateKeyword())
2549OS <<
Node->getMemberNameInfo();
2550 if(
Node->hasExplicitTemplateArgs())
2556 for(
unsignedI = 0, N =
E->getNumArgs(); I != N; ++I) {
2566 E->getQueriedType().print(OS, Policy);
2572PrintExpr(
E->getQueriedExpression());
2578PrintExpr(
E->getOperand());
2583PrintExpr(
E->getPattern());
2588OS <<
"sizeof...("<< *
E->getPack() <<
")";
2592PrintExpr(
E->getPackIdExpression());
2594PrintExpr(
E->getIndexExpr());
2598voidStmtPrinter::VisitResolvedUnexpandedPackExpr(
2600OS <<
"<<resolved pack(";
2602 E->getExprs().begin(),
E->getExprs().end(),
2603[
this](
auto*
X) { PrintExpr(X); }, [
this] { OS <<
", "; });
2607voidStmtPrinter::VisitSubstNonTypeTemplateParmPackExpr(
2609OS << *
Node->getParameterPack();
2612voidStmtPrinter::VisitSubstNonTypeTemplateParmExpr(
2614Visit(
Node->getReplacement());
2618OS << *
E->getParameterPack();
2622PrintExpr(
Node->getSubExpr());
2627 if(
E->getLHS()) {
2628PrintExpr(
E->getLHS());
2632 if(
E->getRHS()) {
2634PrintExpr(
E->getRHS());
2641llvm::interleaveComma(
Node->getInitExprs(), OS,
2642[&](
Expr*
E) { PrintExpr(E); });
2650 if(
E->getTemplateKWLoc().isValid())
2652OS <<
E->getFoundDecl()->getName();
2655 E->getNamedConcept()->getTemplateParameters());
2660 autoLocalParameters =
E->getLocalParameters();
2661 if(!LocalParameters.empty()) {
2663 for(
ParmVarDecl*LocalParam : LocalParameters) {
2664PrintRawDecl(LocalParam);
2665 if(LocalParam != LocalParameters.back())
2672 autoRequirements =
E->getRequirements();
2674 if(
auto*TypeReq = dyn_cast<concepts::TypeRequirement>(Req)) {
2675 if(TypeReq->isSubstitutionFailure())
2676OS <<
"<<error-type>>";
2678TypeReq->getType()->getType().print(OS, Policy);
2679}
else if(
auto*ExprReq = dyn_cast<concepts::ExprRequirement>(Req)) {
2680 if(ExprReq->isCompound())
2682 if(ExprReq->isExprSubstitutionFailure())
2683OS <<
"<<error-expression>>";
2685PrintExpr(ExprReq->getExpr());
2686 if(ExprReq->isCompound()) {
2688 if(ExprReq->getNoexceptLoc().isValid())
2690 const auto&RetReq = ExprReq->getReturnTypeRequirement();
2691 if(!RetReq.isEmpty()) {
2693 if(RetReq.isSubstitutionFailure())
2694OS <<
"<<error-type>>";
2695 else if(RetReq.isTypeConstraint())
2696RetReq.getTypeConstraint()->print(OS, Policy);
2700 auto*NestedReq = cast<concepts::NestedRequirement>(Req);
2702 if(NestedReq->hasInvalidConstraint())
2703OS <<
"<<error-expression>>";
2705PrintExpr(NestedReq->getConstraintExpr());
2715Visit(S->getBody());
2720 if(S->getOperand()) {
2722Visit(S->getOperand());
2727voidStmtPrinter::VisitCoawaitExpr(
CoawaitExpr*S) {
2729PrintExpr(S->getOperand());
2734PrintExpr(S->getOperand());
2737voidStmtPrinter::VisitCoyieldExpr(
CoyieldExpr*S) {
2739PrintExpr(S->getOperand());
2746VisitStringLiteral(
Node->getString());
2751Visit(
E->getSubExpr());
2757 for(
autoI = Ch.begin(),
E= Ch.end(); I !=
E; ++I) {
2758 if(I != Ch.begin())
2767 for(
unsignedI = 0, N =
E->getNumElements(); I != N; ++I) {
2774Visit(Element.Value);
2775 if(Element.isPackExpansion())
2783 Node->getEncodedType().
print(OS, Policy);
2788OS <<
"@selector(";
2794OS <<
"@protocol("<< *
Node->getProtocol() <<
')';
2819 for(
unsignedi = 0, e = Mess->
getNumArgs(); i != e; ++i) {
2821 if(i > 0) OS <<
' ';
2829PrintExpr(Mess->
getArg(i));
2836OS << (
Node->getValue() ?
"__objc_yes":
"__objc_no");
2841PrintExpr(
E->getSubExpr());
2846OS <<
'('<<
E->getBridgeKindName();
2849PrintExpr(
E->getSubExpr());
2858 if(isa<FunctionNoProtoType>(AFT)) {
2860}
else if(!BD->
param_empty() || cast<FunctionProtoType>(AFT)->isVariadic()) {
2865std::string ParamStr = (*AI)->getNameAsString();
2866(*AI)->getType().print(OS, Policy, ParamStr);
2869 const auto*FT = cast<FunctionProtoType>(AFT);
2870 if(FT->isVariadic()) {
2880PrintExpr(
Node->getSourceExpr());
2885llvm_unreachable(
"Cannot print TypoExpr nodes");
2889OS <<
"<recovery-expr>(";
2890 const char*Sep =
"";
2891 for(
Expr*
E:
Node->subExpressions()) {
2900OS <<
"__builtin_astype(";
2901PrintExpr(
Node->getSrcExpr());
2908PrintExpr(
Node->getArgLValue());
2921StringRef NL,
const ASTContext*Context)
const{
2922StmtPrinter
P(Out, Helper, Policy, Indentation, NL, Context);
2923 P.Visit(
const_cast<Stmt*
>(
this));
2928 unsignedIndentation, StringRef NL,
2930StmtPrinter
P(Out, Helper, Policy, Indentation, NL, Context);
2931 P.PrintControlledStmt(
const_cast<Stmt*
>(
this));
2937llvm::raw_string_ostream TempOut(Buf);
2941Out <<
JsonFormat(TempOut.str(), AddQuotes);
Defines the clang::ASTContext interface.
static Decl::Kind getKind(const Decl *D)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines enumerations for expression traits intrinsics.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
This file defines OpenMP AST classes for clauses.
Defines some OpenMP-specific enums and functions.
Defines an enumeration for C++ overloaded operators.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Defines the clang::SourceLocation class and associated facilities.
Defines the Objective-C statement AST node classes.
This file defines OpenMP AST classes for executable directives and clauses.
static bool isImplicitThis(const Expr *E)
static bool isImplicitSelf(const Expr *E)
static void PrintFloatingLiteral(raw_ostream &OS, FloatingLiteral *Node, bool PrintSuffix)
static bool printExprAsWritten(raw_ostream &OS, Expr *E, const ASTContext *Context)
Prints the given expression using the original source text.
This file defines SYCL AST classes used to represent calls to SYCL kernels.
Defines enumerations for the type traits support.
C Language Family Type Representation.
__device__ __2f16 float __ockl_bool s
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
const LangOptions & getLangOpts() const
AddrLabelExpr - The GNU address of label extension, representing &&label.
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Represents a loop initializing the elements of an array.
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Attr - This represents one attribute.
void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const
Represents an attribute applied to a statement.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
A builtin binary operation expression such as "x + y" or "x <= y".
StringRef getOpcodeStr() const
Represents a block literal declaration, which is like an unnamed FunctionDecl.
param_iterator param_end()
MutableArrayRef< ParmVarDecl * >::iterator param_iterator
param_iterator param_begin()
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
BreakStmt - This represents a break.
Represents a C++2a __builtin_bit_cast(T, v) expression.
This class is used for builtin types like 'int'.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr....
Represents a call to a CUDA kernel function.
A C++ addrspace_cast expression (currently only enabled for OpenCL).
Represents binding an expression to a temporary.
A boolean literal, per ([C++ lex.bool] Boolean literals).
CXXCatchStmt - This represents a C++ catch block.
A C++ const_cast expression (C++ [expr.const.cast]).
Represents a call to a C++ constructor.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Represents a folding of a pack over an operator.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Represents a call to an inherited base class constructor from an inheriting constructor.
Represents a call to a member function that may be written either with member call syntax (e....
Represents a static or instance method of a struct/union/class.
Abstract class common to all of the C++ "named"/"keyword" casts.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
The null pointer literal (C++11 [lex.nullptr])
A call to an overloaded operator written using operator syntax.
Represents a list-initialization with parenthesis.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
A rewritten comparison expression that was originally written using operator syntax.
An expression "T()" which creates an rvalue of a non-class type T.
A C++ static_cast expression (C++ [expr.static.cast]).
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Represents a C++ functional cast expression that builds a temporary object.
Represents the this expression in C++.
A C++ throw-expression (C++ [except.throw]).
CXXTryStmt - A C++ try block, including all handlers.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
This captures a statement into a function.
CaseStmt - Represent a case statement.
static CharSourceRange getTokenRange(SourceRange R)
static void print(unsigned val, CharacterLiteralKind Kind, raw_ostream &OS)
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Represents a 'co_await' expression.
CompoundAssignOperator - For compound assignments (e.g.
CompoundLiteralExpr - [C99 6.5.2.5].
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConditionalOperator - The ?: ternary operator.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ContinueStmt - This represents a continue.
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Represents a 'co_return' statement in the C++ Coroutines TS.
Represents the body of a coroutine.
Represents a 'co_yield' expression.
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
const char * getDeclKindName() const
static void printGroup(Decl **Begin, unsigned NumDecls, raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation=0)
void print(raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const
IdentifierInfo * getAsIdentifierInfo() const
Retrieve the IdentifierInfo * stored in this declaration name, or null if this declaration name isn't...
NameKind getNameKind() const
Determine what kind of name this is.
Represents a 'co_await' expression while the type of the promise is dependent.
A qualified reference to a name whose declaration cannot yet be resolved.
Represents a single C99 designator.
Represents a C99 designated initializer expression.
DoStmt - This represents a 'do/while' stmt.
void print(llvm::raw_ostream &OS, const PrintingPolicy &PP) const
Prints the node to the given output stream.
Represents a reference to #emded data.
Represents an expression â generally a full-expression â that introduces cleanups to be run at the en...
This represents one expression.
An expression trait intrinsic.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
bool isAnonymousStructOrUnion() const
Determines whether this field is a representative for an anonymous struct or union.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
ArrayRef< ParmVarDecl * > parameters() const
bool isVariadic() const
Whether this function is variadic.
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Represents a prototype with parameter type info, e.g.
void printExceptionSpecification(raw_ostream &OS, const PrintingPolicy &Policy) const
FunctionType - C99 6.7.5.3 - Function Declarators.
This represents a GCC inline-assembly statement extension.
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Represents a C11 generic selection.
AssociationTy< false > Association
GotoStmt - This represents a direct goto.
This class represents temporary values used to represent inout and out arguments in HLSL.
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Represents an implicitly-generated value initialization of an object of a given type.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
LabelStmt - Represents a label, which has a substatement.
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
llvm::RoundingMode RoundingMode
FPExceptionModeKind
Possible floating point exception behavior.
static StringRef getSourceText(CharSourceRange Range, const SourceManager &SM, const LangOptions &LangOpts, bool *Invalid=nullptr)
Returns a string for the source that the range encompasses.
This represents a Microsoft inline-assembly statement extension.
Representation of a Microsoft __if_exists or __if_not_exists statement with a dependent name.
A member reference to an MSPropertyDecl.
MS property subscript expression.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
Represents a place-holder for an object not to be initialized by anything.
NullStmt - This is the null statement ";": C99 6.8.3p3.
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
This represents '#pragma omp atomic' directive.
This represents '#pragma omp barrier' directive.
This represents '#pragma omp cancel' directive.
This represents '#pragma omp cancellation point' directive.
Representation of an OpenMP canonical loop.
This represents '#pragma omp critical' directive.
This represents implicit clause 'depend' for the '#pragma omp task' directive.
This represents '#pragma omp depobj' directive.
This represents '#pragma omp dispatch' directive.
This represents '#pragma omp distribute' directive.
This represents '#pragma omp distribute parallel for' composite directive.
This represents '#pragma omp distribute parallel for simd' composite directive.
This represents '#pragma omp distribute simd' composite directive.
This represents '#pragma omp error' directive.
This is a basic class for representing single OpenMP executable directive.
This represents '#pragma omp flush' directive.
This represents '#pragma omp for' directive.
This represents '#pragma omp for simd' directive.
This represents '#pragma omp loop' directive.
Represents the '#pragma omp interchange' loop transformation directive.
This represents '#pragma omp interop' directive.
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
This represents '#pragma omp masked' directive.
This represents '#pragma omp masked taskloop' directive.
This represents '#pragma omp masked taskloop simd' directive.
This represents '#pragma omp master' directive.
This represents '#pragma omp master taskloop' directive.
This represents '#pragma omp master taskloop simd' directive.
This represents '#pragma omp ordered' directive.
This represents '#pragma omp parallel' directive.
This represents '#pragma omp parallel for' directive.
This represents '#pragma omp parallel for simd' directive.
This represents '#pragma omp parallel loop' directive.
This represents '#pragma omp parallel masked' directive.
This represents '#pragma omp parallel masked taskloop' directive.
This represents '#pragma omp parallel masked taskloop simd' directive.
This represents '#pragma omp parallel master' directive.
This represents '#pragma omp parallel master taskloop' directive.
This represents '#pragma omp parallel master taskloop simd' directive.
This represents '#pragma omp parallel sections' directive.
Represents the '#pragma omp reverse' loop transformation directive.
This represents '#pragma omp scan' directive.
This represents '#pragma omp scope' directive.
This represents '#pragma omp section' directive.
This represents '#pragma omp sections' directive.
This represents '#pragma omp simd' directive.
This represents '#pragma omp single' directive.
This represents '#pragma omp target data' directive.
This represents '#pragma omp target' directive.
This represents '#pragma omp target enter data' directive.
This represents '#pragma omp target exit data' directive.
This represents '#pragma omp target parallel' directive.
This represents '#pragma omp target parallel for' directive.
This represents '#pragma omp target parallel for simd' directive.
This represents '#pragma omp target parallel loop' directive.
This represents '#pragma omp target simd' directive.
This represents '#pragma omp target teams' directive.
This represents '#pragma omp target teams distribute' combined directive.
This represents '#pragma omp target teams distribute parallel for' combined directive.
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
This represents '#pragma omp target teams distribute simd' combined directive.
This represents '#pragma omp target teams loop' directive.
This represents '#pragma omp target update' directive.
This represents '#pragma omp task' directive.
This represents '#pragma omp taskloop' directive.
This represents '#pragma omp taskloop simd' directive.
This represents '#pragma omp taskgroup' directive.
This represents '#pragma omp taskwait' directive.
This represents '#pragma omp taskyield' directive.
This represents '#pragma omp teams' directive.
This represents '#pragma omp teams distribute' directive.
This represents '#pragma omp teams distribute parallel for' composite directive.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
This represents '#pragma omp teams distribute simd' combined directive.
This represents '#pragma omp teams loop' directive.
This represents the '#pragma omp tile' loop transformation directive.
This represents the '#pragma omp unroll' loop transformation directive.
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Represents Objective-C's @catch statement.
Represents Objective-C's @finally statement.
Represents Objective-C's @synchronized statement.
Represents Objective-C's @throw statement.
Represents Objective-C's @try ... @catch ... @finally statement.
Represents Objective-C's @autoreleasepool Statement.
A runtime availability query.
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
ObjCBoxedExpr - used for generalized expression boxing.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
ObjCEncodeExpr, used for @encode in Objective-C.
Represents Objective-C's collection statement.
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
An expression that sends a message to the given Objective-C object or class.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Selector getSelector() const
@ SuperInstance
The receiver is the instance of the superclass object.
@ Instance
The receiver is an object instance.
@ SuperClass
The receiver is a superclass.
@ Class
The receiver is a class.
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
ObjCProtocolExpr used for protocol expression in Objective-C.
ObjCSelectorExpr used for @selector in Objective-C.
ObjCStringLiteral, used for Objective-C string literals i.e.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Helper class for OffsetOfExpr.
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
@ Array
An index into an array.
@ Base
An implicit indirection through a C++ base class, when the field found is in a base class.
Kind getKind() const
Determine what kind of offsetof node this is.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
This class represents a compute construct, representing a 'Kind' of âparallelâ, 'serial',...
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
This class represents a 'loop' construct.
Represents a C++11 pack expansion that produces a sequence of expressions.
ParenExpr - This represents a parenthesized expression, e.g.
Represents a parameter to a function.
[C99 6.4.2.2] - A predefined identifier such as func.
StringRef getIdentKindName() const
virtual bool handledStmt(Stmt *E, raw_ostream &OS)=0
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
A (possibly-)qualified type.
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Represents a __leave statement.
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
static std::string getPropertyNameFromSetterSelector(Selector Sel)
Return the property name for the given setter selector.
Smart pointer class that efficiently represents Objective-C method names.
StringRef getNameForSlot(unsigned argIndex) const
Retrieve the name at a given position in the selector.
const IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
bool isUnarySelector() const
unsigned getNumArgs() const
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Represents an expression that computes the length of a parameter pack.
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
RetTy Visit(PTR(Stmt) S, ParamTys... P)
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Stmt - This represents one statement.
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
void printJson(raw_ostream &Out, PrinterHelper *Helper, const PrintingPolicy &Policy, bool AddQuotes) const
Pretty-prints in JSON format.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
void printPrettyControlled(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
llvm::iterator_range< child_iterator > child_range
void dumpPretty(const ASTContext &Context) const
dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source...
StringLiteral - This represents a string literal expression, e.g.
void outputString(raw_ostream &OS) const
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Represents a reference to a non-type template parameter pack that has been substituted with a non-tem...
SwitchStmt - This represents a 'switch' stmt.
A template argument list.
unsigned size() const
Retrieve the number of template arguments in this template argument list.
const TemplateArgument & get(unsigned Idx) const
Retrieve the template argument at a given index.
ArrayRef< TemplateArgument > asArray() const
Produce this as an array ref.
Represents a template argument.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
@ Pack
The template argument is actually a parameter pack.
ArgKind getKind() const
Return the kind of stored template argument.
Stores a list of template parameters for a TemplateDecl and its derived classes.
A container of type source information.
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
const T * castAs() const
Member-template castAs<specific type>.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
A call to a literal operator (C++11 [over.literal]) written as a user-defined literal (C++11 [lit....
@ LOK_String
operator "" X (const CharT *, size_t)
@ LOK_Raw
Raw form: operator "" X (const char *)
@ LOK_Floating
operator "" X (long double)
@ LOK_Integer
operator "" X (unsigned long long)
@ LOK_Template
Raw form: operator "" X<cs...> ()
@ LOK_Character
operator "" X (CharT)
Represents a call to the builtin function __builtin_va_arg.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
@ CInit
C-style initialization with assignment.
@ CallInit
Call-style initialization (C++98)
WhileStmt - This represents a 'while' stmt.
A static requirement that can be used in a requires-expression to check properties of types and expre...
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ LCK_ByCopy
Capturing by copy (a.k.a., by value)
@ LCK_ByRef
Capturing by reference.
@ LCK_VLAType
Capturing variable-length array type.
@ LCK_StarThis
Capturing the *this object by copy.
@ LCK_This
Capturing the *this object by reference.
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
std::string JsonFormat(StringRef RawSR, bool AddQuotes)
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
const FunctionProtoType * T
void printTemplateArgumentList(raw_ostream &OS, ArrayRef< TemplateArgument > Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL=nullptr)
Print a template argument list, including the '<' and '>' enclosing the template arguments.
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.
CXXNewInitializationStyle
const Expr * RHS
The original right-hand side.
BinaryOperatorKind Opcode
The original opcode, prior to rewriting.
const Expr * LHS
The original left-hand side.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
DeclarationName getName() const
getName - Returns the embedded declaration name.
void printName(raw_ostream &OS, PrintingPolicy Policy) const
printName - Print the human-readable name to a stream.
Iterator range representation begin:end[:step].
An element in an Objective-C dictionary literal.
Describes how types, statements, expressions, and declarations should be printed.
unsigned Alignof
Whether we can use 'alignof' rather than '__alignof'.
unsigned CleanUglifiedParameters
Whether to strip underscores when printing reserved parameter names.
unsigned ConstantsAsWritten
Whether we should print the constant expressions as written in the sources.
unsigned IncludeNewlines
When true, include newlines after statements like "break", etc.
unsigned Indentation
The number of spaces to use to indent each line.
unsigned TerseOutput
Provide a 'terse' output.
unsigned UnderscoreAlignof
Whether we can use '_Alignof' rather than '__alignof'.
unsigned SuppressImplicitBase
When true, don't print the implicit 'self' or 'this' expressions.
Iterator for iterating over Stmt * arrays that contain only T *.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4