clang  10.0.0svn
TextNodeDumper.cpp
Go to the documentation of this file.
1 //===--- TextNodeDumper.cpp - Printing of AST nodes -----------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements AST dumping of components of individual AST nodes.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "clang/AST/DeclFriend.h"
15 #include "clang/AST/DeclOpenMP.h"
16 #include "clang/AST/DeclTemplate.h"
17 #include "clang/AST/LocInfoType.h"
18 
19 using namespace clang;
20 
21 static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
22 
23 template <typename T>
24 static void dumpPreviousDeclImpl(raw_ostream &OS, const Mergeable<T> *D) {
25  const T *First = D->getFirstDecl();
26  if (First != D)
27  OS << " first " << First;
28 }
29 
30 template <typename T>
31 static void dumpPreviousDeclImpl(raw_ostream &OS, const Redeclarable<T> *D) {
32  const T *Prev = D->getPreviousDecl();
33  if (Prev)
34  OS << " prev " << Prev;
35 }
36 
37 /// Dump the previous declaration in the redeclaration chain for a declaration,
38 /// if any.
39 static void dumpPreviousDecl(raw_ostream &OS, const Decl *D) {
40  switch (D->getKind()) {
41 #define DECL(DERIVED, BASE) \
42  case Decl::DERIVED: \
43  return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
44 #define ABSTRACT_DECL(DECL)
45 #include "clang/AST/DeclNodes.inc"
46  }
47  llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
48 }
49 
50 TextNodeDumper::TextNodeDumper(raw_ostream &OS, bool ShowColors,
51  const SourceManager *SM,
52  const PrintingPolicy &PrintPolicy,
53  const comments::CommandTraits *Traits)
54  : TextTreeStructure(OS, ShowColors), OS(OS), ShowColors(ShowColors), SM(SM),
55  PrintPolicy(PrintPolicy), Traits(Traits) {}
56 
58  const comments::FullComment *FC) {
59  if (!C) {
60  ColorScope Color(OS, ShowColors, NullColor);
61  OS << "<<<NULL>>>";
62  return;
63  }
64 
65  {
66  ColorScope Color(OS, ShowColors, CommentColor);
67  OS << C->getCommentKindName();
68  }
69  dumpPointer(C);
71 
72  ConstCommentVisitor<TextNodeDumper, void,
73  const comments::FullComment *>::visit(C, FC);
74 }
75 
76 void TextNodeDumper::Visit(const Attr *A) {
77  {
78  ColorScope Color(OS, ShowColors, AttrColor);
79 
80  switch (A->getKind()) {
81 #define ATTR(X) \
82  case attr::X: \
83  OS << #X; \
84  break;
85 #include "clang/Basic/AttrList.inc"
86  }
87  OS << "Attr";
88  }
89  dumpPointer(A);
91  if (A->isInherited())
92  OS << " Inherited";
93  if (A->isImplicit())
94  OS << " Implicit";
95 
97 }
98 
100  const Decl *From, StringRef Label) {
101  OS << "TemplateArgument";
102  if (R.isValid())
103  dumpSourceRange(R);
104 
105  if (From)
106  dumpDeclRef(From, Label);
107 
109 }
110 
112  if (!Node) {
113  ColorScope Color(OS, ShowColors, NullColor);
114  OS << "<<<NULL>>>";
115  return;
116  }
117  {
118  ColorScope Color(OS, ShowColors, StmtColor);
119  OS << Node->getStmtClassName();
120  }
121  dumpPointer(Node);
123 
124  if (Node->isOMPStructuredBlock())
125  OS << " openmp_structured_block";
126 
127  if (const auto *E = dyn_cast<Expr>(Node)) {
128  dumpType(E->getType());
129 
130  {
131  ColorScope Color(OS, ShowColors, ValueKindColor);
132  switch (E->getValueKind()) {
133  case VK_RValue:
134  break;
135  case VK_LValue:
136  OS << " lvalue";
137  break;
138  case VK_XValue:
139  OS << " xvalue";
140  break;
141  }
142  }
143 
144  {
145  ColorScope Color(OS, ShowColors, ObjectKindColor);
146  switch (E->getObjectKind()) {
147  case OK_Ordinary:
148  break;
149  case OK_BitField:
150  OS << " bitfield";
151  break;
152  case OK_ObjCProperty:
153  OS << " objcproperty";
154  break;
155  case OK_ObjCSubscript:
156  OS << " objcsubscript";
157  break;
158  case OK_VectorComponent:
159  OS << " vectorcomponent";
160  break;
161  }
162  }
163  }
164 
166 }
167 
168 void TextNodeDumper::Visit(const Type *T) {
169  if (!T) {
170  ColorScope Color(OS, ShowColors, NullColor);
171  OS << "<<<NULL>>>";
172  return;
173  }
174  if (isa<LocInfoType>(T)) {
175  {
176  ColorScope Color(OS, ShowColors, TypeColor);
177  OS << "LocInfo Type";
178  }
179  dumpPointer(T);
180  return;
181  }
182 
183  {
184  ColorScope Color(OS, ShowColors, TypeColor);
185  OS << T->getTypeClassName() << "Type";
186  }
187  dumpPointer(T);
188  OS << " ";
189  dumpBareType(QualType(T, 0), false);
190 
191  QualType SingleStepDesugar =
193  if (SingleStepDesugar != QualType(T, 0))
194  OS << " sugar";
195 
196  if (T->isDependentType())
197  OS << " dependent";
198  else if (T->isInstantiationDependentType())
199  OS << " instantiation_dependent";
200 
201  if (T->isVariablyModifiedType())
202  OS << " variably_modified";
204  OS << " contains_unexpanded_pack";
205  if (T->isFromAST())
206  OS << " imported";
207 
209 }
210 
212  OS << "QualType";
214  OS << " ";
215  dumpBareType(T, false);
216  OS << " " << T.split().Quals.getAsString();
217 }
218 
219 void TextNodeDumper::Visit(const Decl *D) {
220  if (!D) {
221  ColorScope Color(OS, ShowColors, NullColor);
222  OS << "<<<NULL>>>";
223  return;
224  }
225 
226  Context = &D->getASTContext();
227  {
228  ColorScope Color(OS, ShowColors, DeclKindNameColor);
229  OS << D->getDeclKindName() << "Decl";
230  }
231  dumpPointer(D);
232  if (D->getLexicalDeclContext() != D->getDeclContext())
233  OS << " parent " << cast<Decl>(D->getDeclContext());
234  dumpPreviousDecl(OS, D);
236  OS << ' ';
238  if (D->isFromASTFile())
239  OS << " imported";
240  if (Module *M = D->getOwningModule())
241  OS << " in " << M->getFullModuleName();
242  if (auto *ND = dyn_cast<NamedDecl>(D))
244  const_cast<NamedDecl *>(ND)))
245  AddChild([=] { OS << "also in " << M->getFullModuleName(); });
246  if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
247  if (ND->isHidden())
248  OS << " hidden";
249  if (D->isImplicit())
250  OS << " implicit";
251 
252  if (D->isUsed())
253  OS << " used";
254  else if (D->isThisDeclarationReferenced())
255  OS << " referenced";
256 
257  if (D->isInvalidDecl())
258  OS << " invalid";
259  if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
260  if (FD->isConstexprSpecified())
261  OS << " constexpr";
262  if (FD->isConsteval())
263  OS << " consteval";
264  }
265 
266  if (!isa<FunctionDecl>(*D)) {
267  const auto *MD = dyn_cast<ObjCMethodDecl>(D);
268  if (!MD || !MD->isThisDeclarationADefinition()) {
269  const auto *DC = dyn_cast<DeclContext>(D);
270  if (DC && DC->hasExternalLexicalStorage()) {
271  ColorScope Color(OS, ShowColors, UndeserializedColor);
272  OS << " <undeserialized declarations>";
273  }
274  }
275  }
276 
278 }
279 
281  OS << "CXXCtorInitializer";
282  if (Init->isAnyMemberInitializer()) {
283  OS << ' ';
284  dumpBareDeclRef(Init->getAnyMember());
285  } else if (Init->isBaseInitializer()) {
286  dumpType(QualType(Init->getBaseClass(), 0));
287  } else if (Init->isDelegatingInitializer()) {
288  dumpType(Init->getTypeSourceInfo()->getType());
289  } else {
290  llvm_unreachable("Unknown initializer type");
291  }
292 }
293 
295  OS << "capture";
296  if (C.isByRef())
297  OS << " byref";
298  if (C.isNested())
299  OS << " nested";
300  if (C.getVariable()) {
301  OS << ' ';
303  }
304 }
305 
307  if (!C) {
308  ColorScope Color(OS, ShowColors, NullColor);
309  OS << "<<<NULL>>> OMPClause";
310  return;
311  }
312  {
313  ColorScope Color(OS, ShowColors, AttrColor);
314  StringRef ClauseName(getOpenMPClauseName(C->getClauseKind()));
315  OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
316  << ClauseName.drop_front() << "Clause";
317  }
318  dumpPointer(C);
320  if (C->isImplicit())
321  OS << " <implicit>";
322 }
323 
325  const TypeSourceInfo *TSI = A.getTypeSourceInfo();
326  if (TSI) {
327  OS << "case ";
328  dumpType(TSI->getType());
329  } else {
330  OS << "default";
331  }
332 
333  if (A.isSelected())
334  OS << " selected";
335 }
336 
337 void TextNodeDumper::dumpPointer(const void *Ptr) {
338  ColorScope Color(OS, ShowColors, AddressColor);
339  OS << ' ' << Ptr;
340 }
341 
343  if (!SM)
344  return;
345 
346  ColorScope Color(OS, ShowColors, LocationColor);
347  SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
348 
349  // The general format we print out is filename:line:col, but we drop pieces
350  // that haven't changed since the last loc printed.
351  PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
352 
353  if (PLoc.isInvalid()) {
354  OS << "<invalid sloc>";
355  return;
356  }
357 
358  if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
359  OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
360  << PLoc.getColumn();
361  LastLocFilename = PLoc.getFilename();
362  LastLocLine = PLoc.getLine();
363  } else if (PLoc.getLine() != LastLocLine) {
364  OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
365  LastLocLine = PLoc.getLine();
366  } else {
367  OS << "col" << ':' << PLoc.getColumn();
368  }
369 }
370 
372  // Can't translate locations if a SourceManager isn't available.
373  if (!SM)
374  return;
375 
376  OS << " <";
377  dumpLocation(R.getBegin());
378  if (R.getBegin() != R.getEnd()) {
379  OS << ", ";
380  dumpLocation(R.getEnd());
381  }
382  OS << ">";
383 
384  // <t2.c:123:421[blah], t2.c:412:321>
385 }
386 
388  ColorScope Color(OS, ShowColors, TypeColor);
389 
390  SplitQualType T_split = T.split();
391  OS << "'" << QualType::getAsString(T_split, PrintPolicy) << "'";
392 
393  if (Desugar && !T.isNull()) {
394  // If the type is sugared, also dump a (shallow) desugared type.
395  SplitQualType D_split = T.getSplitDesugaredType();
396  if (T_split != D_split)
397  OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
398  }
399 }
400 
402  OS << ' ';
403  dumpBareType(T);
404 }
405 
407  if (!D) {
408  ColorScope Color(OS, ShowColors, NullColor);
409  OS << "<<<NULL>>>";
410  return;
411  }
412 
413  {
414  ColorScope Color(OS, ShowColors, DeclKindNameColor);
415  OS << D->getDeclKindName();
416  }
417  dumpPointer(D);
418 
419  if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
420  ColorScope Color(OS, ShowColors, DeclNameColor);
421  OS << " '" << ND->getDeclName() << '\'';
422  }
423 
424  if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
425  dumpType(VD->getType());
426 }
427 
429  if (ND->getDeclName()) {
430  ColorScope Color(OS, ShowColors, DeclNameColor);
431  OS << ' ' << ND->getNameAsString();
432  }
433 }
434 
436  switch (AS) {
437  case AS_none:
438  break;
439  case AS_public:
440  OS << "public";
441  break;
442  case AS_protected:
443  OS << "protected";
444  break;
445  case AS_private:
446  OS << "private";
447  break;
448  }
449 }
450 
451 void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
452  if (!D)
453  return;
454 
455  AddChild([=] {
456  if (!Label.empty())
457  OS << Label << ' ';
458  dumpBareDeclRef(D);
459  });
460 }
461 
462 const char *TextNodeDumper::getCommandName(unsigned CommandID) {
463  if (Traits)
464  return Traits->getCommandInfo(CommandID)->Name;
465  const comments::CommandInfo *Info =
467  if (Info)
468  return Info->Name;
469  return "<not a builtin command>";
470 }
471 
473  const comments::FullComment *) {
474  OS << " Text=\"" << C->getText() << "\"";
475 }
476 
479  OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
480  switch (C->getRenderKind()) {
482  OS << " RenderNormal";
483  break;
485  OS << " RenderBold";
486  break;
488  OS << " RenderMonospaced";
489  break;
491  OS << " RenderEmphasized";
492  break;
493  }
494 
495  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
496  OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
497 }
498 
501  OS << " Name=\"" << C->getTagName() << "\"";
502  if (C->getNumAttrs() != 0) {
503  OS << " Attrs: ";
504  for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
506  OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
507  }
508  }
509  if (C->isSelfClosing())
510  OS << " SelfClosing";
511 }
512 
515  OS << " Name=\"" << C->getTagName() << "\"";
516 }
517 
520  OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
521  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
522  OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
523 }
524 
527  OS << " "
529 
530  if (C->isDirectionExplicit())
531  OS << " explicitly";
532  else
533  OS << " implicitly";
534 
535  if (C->hasParamName()) {
536  if (C->isParamIndexValid())
537  OS << " Param=\"" << C->getParamName(FC) << "\"";
538  else
539  OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
540  }
541 
542  if (C->isParamIndexValid() && !C->isVarArgParam())
543  OS << " ParamIndex=" << C->getParamIndex();
544 }
545 
548  if (C->hasParamName()) {
549  if (C->isPositionValid())
550  OS << " Param=\"" << C->getParamName(FC) << "\"";
551  else
552  OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
553  }
554 
555  if (C->isPositionValid()) {
556  OS << " Position=<";
557  for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
558  OS << C->getIndex(i);
559  if (i != e - 1)
560  OS << ", ";
561  }
562  OS << ">";
563  }
564 }
565 
568  OS << " Name=\"" << getCommandName(C->getCommandID())
569  << "\""
570  " CloseName=\""
571  << C->getCloseName() << "\"";
572 }
573 
576  const comments::FullComment *) {
577  OS << " Text=\"" << C->getText() << "\"";
578 }
579 
582  OS << " Text=\"" << C->getText() << "\"";
583 }
584 
586  OS << " null";
587 }
588 
590  OS << " type";
591  dumpType(TA.getAsType());
592 }
593 
595  const TemplateArgument &TA) {
596  OS << " decl";
597  dumpDeclRef(TA.getAsDecl());
598 }
599 
601  OS << " nullptr";
602 }
603 
605  OS << " integral " << TA.getAsIntegral();
606 }
607 
609  OS << " template ";
610  TA.getAsTemplate().dump(OS);
611 }
612 
614  const TemplateArgument &TA) {
615  OS << " template expansion ";
617 }
618 
620  OS << " expr";
621 }
622 
624  OS << " pack";
625 }
626 
627 static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
628  if (Node->path_empty())
629  return;
630 
631  OS << " (";
632  bool First = true;
633  for (CastExpr::path_const_iterator I = Node->path_begin(),
634  E = Node->path_end();
635  I != E; ++I) {
636  const CXXBaseSpecifier *Base = *I;
637  if (!First)
638  OS << " -> ";
639 
640  const CXXRecordDecl *RD =
641  cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
642 
643  if (Base->isVirtual())
644  OS << "virtual ";
645  OS << RD->getName();
646  First = false;
647  }
648 
649  OS << ')';
650 }
651 
653  if (Node->hasInitStorage())
654  OS << " has_init";
655  if (Node->hasVarStorage())
656  OS << " has_var";
657  if (Node->hasElseStorage())
658  OS << " has_else";
659 }
660 
662  if (Node->hasInitStorage())
663  OS << " has_init";
664  if (Node->hasVarStorage())
665  OS << " has_var";
666 }
667 
669  if (Node->hasVarStorage())
670  OS << " has_var";
671 }
672 
674  OS << " '" << Node->getName() << "'";
675 }
676 
678  OS << " '" << Node->getLabel()->getName() << "'";
679  dumpPointer(Node->getLabel());
680 }
681 
683  if (Node->caseStmtIsGNURange())
684  OS << " gnu_range";
685 }
686 
688  if (Node->getResultAPValueKind() != APValue::None) {
689  ColorScope Color(OS, ShowColors, ValueColor);
690  OS << " ";
691  Node->getAPValueResult().printPretty(OS, *Context, Node->getType());
692  }
693 }
694 
696  if (Node->usesADL())
697  OS << " adl";
698 }
699 
701  OS << " <";
702  {
703  ColorScope Color(OS, ShowColors, CastColor);
704  OS << Node->getCastKindName();
705  }
706  dumpBasePath(OS, Node);
707  OS << ">";
708 }
709 
711  VisitCastExpr(Node);
712  if (Node->isPartOfExplicitCast())
713  OS << " part_of_explicit_cast";
714 }
715 
717  OS << " ";
718  dumpBareDeclRef(Node->getDecl());
719  if (Node->getDecl() != Node->getFoundDecl()) {
720  OS << " (";
721  dumpBareDeclRef(Node->getFoundDecl());
722  OS << ")";
723  }
724  switch (Node->isNonOdrUse()) {
725  case NOUR_None: break;
726  case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
727  case NOUR_Constant: OS << " non_odr_use_constant"; break;
728  case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
729  }
730 }
731 
733  const UnresolvedLookupExpr *Node) {
734  OS << " (";
735  if (!Node->requiresADL())
736  OS << "no ";
737  OS << "ADL) = '" << Node->getName() << '\'';
738 
740  E = Node->decls_end();
741  if (I == E)
742  OS << " empty";
743  for (; I != E; ++I)
744  dumpPointer(*I);
745 }
746 
748  {
749  ColorScope Color(OS, ShowColors, DeclKindNameColor);
750  OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
751  }
752  OS << "='" << *Node->getDecl() << "'";
753  dumpPointer(Node->getDecl());
754  if (Node->isFreeIvar())
755  OS << " isFreeIvar";
756 }
757 
759  OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
760 }
761 
763  ColorScope Color(OS, ShowColors, ValueColor);
764  OS << " " << Node->getValue();
765 }
766 
768  bool isSigned = Node->getType()->isSignedIntegerType();
769  ColorScope Color(OS, ShowColors, ValueColor);
770  OS << " " << Node->getValue().toString(10, isSigned);
771 }
772 
774  ColorScope Color(OS, ShowColors, ValueColor);
775  OS << " " << Node->getValueAsString(/*Radix=*/10);
776 }
777 
779  ColorScope Color(OS, ShowColors, ValueColor);
780  OS << " " << Node->getValueAsApproximateDouble();
781 }
782 
784  ColorScope Color(OS, ShowColors, ValueColor);
785  OS << " ";
786  Str->outputString(OS);
787 }
788 
790  if (auto *Field = ILE->getInitializedFieldInUnion()) {
791  OS << " field ";
792  dumpBareDeclRef(Field);
793  }
794 }
795 
797  if (E->isResultDependent())
798  OS << " result_dependent";
799 }
800 
802  OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
803  << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
804  if (!Node->canOverflow())
805  OS << " cannot overflow";
806 }
807 
810  switch (Node->getKind()) {
811  case UETT_SizeOf:
812  OS << " sizeof";
813  break;
814  case UETT_AlignOf:
815  OS << " alignof";
816  break;
817  case UETT_VecStep:
818  OS << " vec_step";
819  break;
821  OS << " __builtin_omp_required_simd_align";
822  break;
824  OS << " __alignof";
825  break;
826  }
827  if (Node->isArgumentType())
828  dumpType(Node->getArgumentType());
829 }
830 
832  OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
833  dumpPointer(Node->getMemberDecl());
834  switch (Node->isNonOdrUse()) {
835  case NOUR_None: break;
836  case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
837  case NOUR_Constant: OS << " non_odr_use_constant"; break;
838  case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
839  }
840 }
841 
843  const ExtVectorElementExpr *Node) {
844  OS << " " << Node->getAccessor().getNameStart();
845 }
846 
848  OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
849 }
850 
852  const CompoundAssignOperator *Node) {
853  OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
854  << "' ComputeLHSTy=";
856  OS << " ComputeResultTy=";
858 }
859 
861  OS << " " << Node->getLabel()->getName();
862  dumpPointer(Node->getLabel());
863 }
864 
866  OS << " " << Node->getCastName() << "<"
867  << Node->getTypeAsWritten().getAsString() << ">"
868  << " <" << Node->getCastKindName();
869  dumpBasePath(OS, Node);
870  OS << ">";
871 }
872 
874  OS << " " << (Node->getValue() ? "true" : "false");
875 }
876 
878  if (Node->isImplicit())
879  OS << " implicit";
880  OS << " this";
881 }
882 
884  const CXXFunctionalCastExpr *Node) {
885  OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
886  << Node->getCastKindName() << ">";
887 }
888 
891  dumpType(Node->getTypeAsWritten());
892  if (Node->isListInitialization())
893  OS << " list";
894 }
895 
897  CXXConstructorDecl *Ctor = Node->getConstructor();
898  dumpType(Ctor->getType());
899  if (Node->isElidable())
900  OS << " elidable";
901  if (Node->isListInitialization())
902  OS << " list";
903  if (Node->isStdInitListInitialization())
904  OS << " std::initializer_list";
905  if (Node->requiresZeroInitialization())
906  OS << " zeroing";
907 }
908 
910  const CXXBindTemporaryExpr *Node) {
911  OS << " (CXXTemporary";
912  dumpPointer(Node);
913  OS << ")";
914 }
915 
917  if (Node->isGlobalNew())
918  OS << " global";
919  if (Node->isArray())
920  OS << " array";
921  if (Node->getOperatorNew()) {
922  OS << ' ';
924  }
925  // We could dump the deallocation function used in case of error, but it's
926  // usually not that interesting.
927 }
928 
930  if (Node->isGlobalDelete())
931  OS << " global";
932  if (Node->isArrayForm())
933  OS << " array";
934  if (Node->getOperatorDelete()) {
935  OS << ' ';
937  }
938 }
939 
942  if (const ValueDecl *VD = Node->getExtendingDecl()) {
943  OS << " extended by ";
944  dumpBareDeclRef(VD);
945  }
946 }
947 
949  for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
950  dumpDeclRef(Node->getObject(i), "cleanup");
951 }
952 
954  dumpPointer(Node->getPack());
955  dumpName(Node->getPack());
956 }
957 
960  OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
961 }
962 
964  OS << " selector=";
965  Node->getSelector().print(OS);
966  switch (Node->getReceiverKind()) {
968  break;
969 
971  OS << " class=";
973  break;
974 
976  OS << " super (instance)";
977  break;
978 
980  OS << " super (class)";
981  break;
982  }
983 }
984 
986  if (auto *BoxingMethod = Node->getBoxingMethod()) {
987  OS << " selector=";
988  BoxingMethod->getSelector().print(OS);
989  }
990 }
991 
993  if (!Node->getCatchParamDecl())
994  OS << " catch all";
995 }
996 
998  dumpType(Node->getEncodedType());
999 }
1000 
1002  OS << " ";
1003  Node->getSelector().print(OS);
1004 }
1005 
1007  OS << ' ' << *Node->getProtocol();
1008 }
1009 
1011  if (Node->isImplicitProperty()) {
1012  OS << " Kind=MethodRef Getter=\"";
1013  if (Node->getImplicitPropertyGetter())
1015  else
1016  OS << "(null)";
1017 
1018  OS << "\" Setter=\"";
1019  if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1020  Setter->getSelector().print(OS);
1021  else
1022  OS << "(null)";
1023  OS << "\"";
1024  } else {
1025  OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1026  << '"';
1027  }
1028 
1029  if (Node->isSuperReceiver())
1030  OS << " super";
1031 
1032  OS << " Messaging=";
1033  if (Node->isMessagingGetter() && Node->isMessagingSetter())
1034  OS << "Getter&Setter";
1035  else if (Node->isMessagingGetter())
1036  OS << "Getter";
1037  else if (Node->isMessagingSetter())
1038  OS << "Setter";
1039 }
1040 
1042  const ObjCSubscriptRefExpr *Node) {
1043  if (Node->isArraySubscriptRefExpr())
1044  OS << " Kind=ArraySubscript GetterForArray=\"";
1045  else
1046  OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1047  if (Node->getAtIndexMethodDecl())
1048  Node->getAtIndexMethodDecl()->getSelector().print(OS);
1049  else
1050  OS << "(null)";
1051 
1052  if (Node->isArraySubscriptRefExpr())
1053  OS << "\" SetterForArray=\"";
1054  else
1055  OS << "\" SetterForDictionary=\"";
1056  if (Node->setAtIndexMethodDecl())
1057  Node->setAtIndexMethodDecl()->getSelector().print(OS);
1058  else
1059  OS << "(null)";
1060 }
1061 
1063  OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1064 }
1065 
1067  if (T->isSpelledAsLValue())
1068  OS << " written as lvalue reference";
1069 }
1070 
1072  switch (T->getSizeModifier()) {
1073  case ArrayType::Normal:
1074  break;
1075  case ArrayType::Static:
1076  OS << " static";
1077  break;
1078  case ArrayType::Star:
1079  OS << " *";
1080  break;
1081  }
1082  OS << " " << T->getIndexTypeQualifiers().getAsString();
1083 }
1084 
1086  OS << " " << T->getSize();
1087  VisitArrayType(T);
1088 }
1089 
1091  OS << " ";
1093  VisitArrayType(T);
1094 }
1095 
1097  const DependentSizedArrayType *T) {
1098  VisitArrayType(T);
1099  OS << " ";
1101 }
1102 
1104  const DependentSizedExtVectorType *T) {
1105  OS << " ";
1107 }
1108 
1110  switch (T->getVectorKind()) {
1112  break;
1114  OS << " altivec";
1115  break;
1117  OS << " altivec pixel";
1118  break;
1120  OS << " altivec bool";
1121  break;
1123  OS << " neon";
1124  break;
1126  OS << " neon poly";
1127  break;
1128  }
1129  OS << " " << T->getNumElements();
1130 }
1131 
1133  auto EI = T->getExtInfo();
1134  if (EI.getNoReturn())
1135  OS << " noreturn";
1136  if (EI.getProducesResult())
1137  OS << " produces_result";
1138  if (EI.getHasRegParm())
1139  OS << " regparm " << EI.getRegParm();
1140  OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1141 }
1142 
1144  auto EPI = T->getExtProtoInfo();
1145  if (EPI.HasTrailingReturn)
1146  OS << " trailing_return";
1147  if (T->isConst())
1148  OS << " const";
1149  if (T->isVolatile())
1150  OS << " volatile";
1151  if (T->isRestrict())
1152  OS << " restrict";
1153  if (T->getExtProtoInfo().Variadic)
1154  OS << " variadic";
1155  switch (EPI.RefQualifier) {
1156  case RQ_None:
1157  break;
1158  case RQ_LValue:
1159  OS << " &";
1160  break;
1161  case RQ_RValue:
1162  OS << " &&";
1163  break;
1164  }
1165  // FIXME: Exception specification.
1166  // FIXME: Consumed parameters.
1167  VisitFunctionType(T);
1168 }
1169 
1171  dumpDeclRef(T->getDecl());
1172 }
1173 
1175  dumpDeclRef(T->getDecl());
1176 }
1177 
1179  switch (T->getUTTKind()) {
1181  OS << " underlying_type";
1182  break;
1183  }
1184 }
1185 
1187  dumpDeclRef(T->getDecl());
1188 }
1189 
1191  OS << " depth " << T->getDepth() << " index " << T->getIndex();
1192  if (T->isParameterPack())
1193  OS << " pack";
1194  dumpDeclRef(T->getDecl());
1195 }
1196 
1198  if (T->isDecltypeAuto())
1199  OS << " decltype(auto)";
1200  if (!T->isDeduced())
1201  OS << " undeduced";
1202 }
1203 
1205  const TemplateSpecializationType *T) {
1206  if (T->isTypeAlias())
1207  OS << " alias";
1208  OS << " ";
1209  T->getTemplateName().dump(OS);
1210 }
1211 
1213  const InjectedClassNameType *T) {
1214  dumpDeclRef(T->getDecl());
1215 }
1216 
1218  dumpDeclRef(T->getDecl());
1219 }
1220 
1222  if (auto N = T->getNumExpansions())
1223  OS << " expansions " << *N;
1224 }
1225 
1227 
1229  dumpName(D);
1231  if (D->isModulePrivate())
1232  OS << " __module_private__";
1233 }
1234 
1236  if (D->isScoped()) {
1237  if (D->isScopedUsingClassTag())
1238  OS << " class";
1239  else
1240  OS << " struct";
1241  }
1242  dumpName(D);
1243  if (D->isModulePrivate())
1244  OS << " __module_private__";
1245  if (D->isFixed())
1246  dumpType(D->getIntegerType());
1247 }
1248 
1250  OS << ' ' << D->getKindName();
1251  dumpName(D);
1252  if (D->isModulePrivate())
1253  OS << " __module_private__";
1254  if (D->isCompleteDefinition())
1255  OS << " definition";
1256 }
1257 
1259  dumpName(D);
1260  dumpType(D->getType());
1261 }
1262 
1264  dumpName(D);
1265  dumpType(D->getType());
1266 
1267  for (const auto *Child : D->chain())
1268  dumpDeclRef(Child);
1269 }
1270 
1272  dumpName(D);
1273  dumpType(D->getType());
1274 
1275  StorageClass SC = D->getStorageClass();
1276  if (SC != SC_None)
1277  OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);
1278  if (D->isInlineSpecified())
1279  OS << " inline";
1280  if (D->isVirtualAsWritten())
1281  OS << " virtual";
1282  if (D->isModulePrivate())
1283  OS << " __module_private__";
1284 
1285  if (D->isPure())
1286  OS << " pure";
1287  if (D->isDefaulted()) {
1288  OS << " default";
1289  if (D->isDeleted())
1290  OS << "_delete";
1291  }
1292  if (D->isDeletedAsWritten())
1293  OS << " delete";
1294  if (D->isTrivial())
1295  OS << " trivial";
1296 
1297  if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
1298  FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
1299  switch (EPI.ExceptionSpec.Type) {
1300  default:
1301  break;
1302  case EST_Unevaluated:
1303  OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
1304  break;
1305  case EST_Uninstantiated:
1306  OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
1307  break;
1308  }
1309  }
1310 
1311  if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
1312  if (MD->size_overridden_methods() != 0) {
1313  auto dumpOverride = [=](const CXXMethodDecl *D) {
1314  SplitQualType T_split = D->getType().split();
1315  OS << D << " " << D->getParent()->getName()
1316  << "::" << D->getNameAsString() << " '"
1317  << QualType::getAsString(T_split, PrintPolicy) << "'";
1318  };
1319 
1320  AddChild([=] {
1321  auto Overrides = MD->overridden_methods();
1322  OS << "Overrides: [ ";
1323  dumpOverride(*Overrides.begin());
1324  for (const auto *Override :
1325  llvm::make_range(Overrides.begin() + 1, Overrides.end())) {
1326  OS << ", ";
1327  dumpOverride(Override);
1328  }
1329  OS << " ]";
1330  });
1331  }
1332  }
1333 
1334  // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
1335  // the Params are set later, it is possible for a dump during debugging to
1336  // encounter a FunctionDecl that has been created but hasn't been assigned
1337  // ParmVarDecls yet.
1338  if (!D->param_empty() && !D->param_begin())
1339  OS << " <<<NULL params x " << D->getNumParams() << ">>>";
1340 }
1341 
1343  dumpName(D);
1344  dumpType(D->getType());
1345  if (D->isMutable())
1346  OS << " mutable";
1347  if (D->isModulePrivate())
1348  OS << " __module_private__";
1349 }
1350 
1352  dumpName(D);
1353  dumpType(D->getType());
1354  StorageClass SC = D->getStorageClass();
1355  if (SC != SC_None)
1356  OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);
1357  switch (D->getTLSKind()) {
1358  case VarDecl::TLS_None:
1359  break;
1360  case VarDecl::TLS_Static:
1361  OS << " tls";
1362  break;
1363  case VarDecl::TLS_Dynamic:
1364  OS << " tls_dynamic";
1365  break;
1366  }
1367  if (D->isModulePrivate())
1368  OS << " __module_private__";
1369  if (D->isNRVOVariable())
1370  OS << " nrvo";
1371  if (D->isInline())
1372  OS << " inline";
1373  if (D->isConstexpr())
1374  OS << " constexpr";
1375  if (D->hasInit()) {
1376  switch (D->getInitStyle()) {
1377  case VarDecl::CInit:
1378  OS << " cinit";
1379  break;
1380  case VarDecl::CallInit:
1381  OS << " callinit";
1382  break;
1383  case VarDecl::ListInit:
1384  OS << " listinit";
1385  break;
1386  }
1387  }
1388  if (D->isParameterPack())
1389  OS << " pack";
1390 }
1391 
1393  dumpName(D);
1394  dumpType(D->getType());
1395 }
1396 
1398  if (D->isNothrow())
1399  OS << " nothrow";
1400 }
1401 
1403  OS << ' ' << D->getImportedModule()->getFullModuleName();
1404 
1405  for (Decl *InitD :
1407  dumpDeclRef(InitD, "initializer");
1408 }
1409 
1411  OS << ' ';
1412  switch (D->getCommentKind()) {
1413  case PCK_Unknown:
1414  llvm_unreachable("unexpected pragma comment kind");
1415  case PCK_Compiler:
1416  OS << "compiler";
1417  break;
1418  case PCK_ExeStr:
1419  OS << "exestr";
1420  break;
1421  case PCK_Lib:
1422  OS << "lib";
1423  break;
1424  case PCK_Linker:
1425  OS << "linker";
1426  break;
1427  case PCK_User:
1428  OS << "user";
1429  break;
1430  }
1431  StringRef Arg = D->getArg();
1432  if (!Arg.empty())
1433  OS << " \"" << Arg << "\"";
1434 }
1435 
1437  const PragmaDetectMismatchDecl *D) {
1438  OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
1439 }
1440 
1442  const OMPExecutableDirective *D) {
1443  if (D->isStandaloneDirective())
1444  OS << " openmp_standalone_directive";
1445 }
1446 
1448  const OMPDeclareReductionDecl *D) {
1449  dumpName(D);
1450  dumpType(D->getType());
1451  OS << " combiner";
1452  dumpPointer(D->getCombiner());
1453  if (const auto *Initializer = D->getInitializer()) {
1454  OS << " initializer";
1456  switch (D->getInitializerKind()) {
1458  OS << " omp_priv = ";
1459  break;
1461  OS << " omp_priv ()";
1462  break;
1464  break;
1465  }
1466  }
1467 }
1468 
1470  for (const auto *C : D->clauselists()) {
1471  AddChild([=] {
1472  if (!C) {
1473  ColorScope Color(OS, ShowColors, NullColor);
1474  OS << "<<<NULL>>> OMPClause";
1475  return;
1476  }
1477  {
1478  ColorScope Color(OS, ShowColors, AttrColor);
1479  StringRef ClauseName(getOpenMPClauseName(C->getClauseKind()));
1480  OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
1481  << ClauseName.drop_front() << "Clause";
1482  }
1483  dumpPointer(C);
1484  dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
1485  });
1486  }
1487 }
1488 
1490  dumpName(D);
1491  dumpType(D->getType());
1492 }
1493 
1495  dumpName(D);
1496  if (D->isInline())
1497  OS << " inline";
1498  if (!D->isOriginalNamespace())
1499  dumpDeclRef(D->getOriginalNamespace(), "original");
1500 }
1501 
1503  OS << ' ';
1505 }
1506 
1508  dumpName(D);
1510 }
1511 
1513  dumpName(D);
1515 }
1516 
1518  const TypeAliasTemplateDecl *D) {
1519  dumpName(D);
1520 }
1521 
1523  VisitRecordDecl(D);
1524  if (!D->isCompleteDefinition())
1525  return;
1526 
1527  AddChild([=] {
1528  {
1529  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1530  OS << "DefinitionData";
1531  }
1532 #define FLAG(fn, name) \
1533  if (D->fn()) \
1534  OS << " " #name;
1535  FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
1536 
1537  FLAG(isGenericLambda, generic);
1538  FLAG(isLambda, lambda);
1539 
1540  FLAG(isAnonymousStructOrUnion, is_anonymous);
1541  FLAG(canPassInRegisters, pass_in_registers);
1542  FLAG(isEmpty, empty);
1543  FLAG(isAggregate, aggregate);
1544  FLAG(isStandardLayout, standard_layout);
1545  FLAG(isTriviallyCopyable, trivially_copyable);
1546  FLAG(isPOD, pod);
1547  FLAG(isTrivial, trivial);
1548  FLAG(isPolymorphic, polymorphic);
1549  FLAG(isAbstract, abstract);
1550  FLAG(isLiteral, literal);
1551 
1552  FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
1553  FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
1554  FLAG(hasMutableFields, has_mutable_fields);
1555  FLAG(hasVariantMembers, has_variant_members);
1556  FLAG(allowConstDefaultInit, can_const_default_init);
1557 
1558  AddChild([=] {
1559  {
1560  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1561  OS << "DefaultConstructor";
1562  }
1563  FLAG(hasDefaultConstructor, exists);
1564  FLAG(hasTrivialDefaultConstructor, trivial);
1565  FLAG(hasNonTrivialDefaultConstructor, non_trivial);
1566  FLAG(hasUserProvidedDefaultConstructor, user_provided);
1567  FLAG(hasConstexprDefaultConstructor, constexpr);
1568  FLAG(needsImplicitDefaultConstructor, needs_implicit);
1569  FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
1570  });
1571 
1572  AddChild([=] {
1573  {
1574  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1575  OS << "CopyConstructor";
1576  }
1577  FLAG(hasSimpleCopyConstructor, simple);
1578  FLAG(hasTrivialCopyConstructor, trivial);
1579  FLAG(hasNonTrivialCopyConstructor, non_trivial);
1580  FLAG(hasUserDeclaredCopyConstructor, user_declared);
1581  FLAG(hasCopyConstructorWithConstParam, has_const_param);
1582  FLAG(needsImplicitCopyConstructor, needs_implicit);
1583  FLAG(needsOverloadResolutionForCopyConstructor,
1584  needs_overload_resolution);
1586  FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
1587  FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
1588  });
1589 
1590  AddChild([=] {
1591  {
1592  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1593  OS << "MoveConstructor";
1594  }
1595  FLAG(hasMoveConstructor, exists);
1596  FLAG(hasSimpleMoveConstructor, simple);
1597  FLAG(hasTrivialMoveConstructor, trivial);
1598  FLAG(hasNonTrivialMoveConstructor, non_trivial);
1599  FLAG(hasUserDeclaredMoveConstructor, user_declared);
1600  FLAG(needsImplicitMoveConstructor, needs_implicit);
1601  FLAG(needsOverloadResolutionForMoveConstructor,
1602  needs_overload_resolution);
1604  FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
1605  });
1606 
1607  AddChild([=] {
1608  {
1609  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1610  OS << "CopyAssignment";
1611  }
1612  FLAG(hasTrivialCopyAssignment, trivial);
1613  FLAG(hasNonTrivialCopyAssignment, non_trivial);
1614  FLAG(hasCopyAssignmentWithConstParam, has_const_param);
1615  FLAG(hasUserDeclaredCopyAssignment, user_declared);
1616  FLAG(needsImplicitCopyAssignment, needs_implicit);
1617  FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
1618  FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
1619  });
1620 
1621  AddChild([=] {
1622  {
1623  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1624  OS << "MoveAssignment";
1625  }
1626  FLAG(hasMoveAssignment, exists);
1627  FLAG(hasSimpleMoveAssignment, simple);
1628  FLAG(hasTrivialMoveAssignment, trivial);
1629  FLAG(hasNonTrivialMoveAssignment, non_trivial);
1630  FLAG(hasUserDeclaredMoveAssignment, user_declared);
1631  FLAG(needsImplicitMoveAssignment, needs_implicit);
1632  FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
1633  });
1634 
1635  AddChild([=] {
1636  {
1637  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1638  OS << "Destructor";
1639  }
1640  FLAG(hasSimpleDestructor, simple);
1641  FLAG(hasIrrelevantDestructor, irrelevant);
1642  FLAG(hasTrivialDestructor, trivial);
1643  FLAG(hasNonTrivialDestructor, non_trivial);
1644  FLAG(hasUserDeclaredDestructor, user_declared);
1645  FLAG(needsImplicitDestructor, needs_implicit);
1646  FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
1648  FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
1649  });
1650  });
1651 
1652  for (const auto &I : D->bases()) {
1653  AddChild([=] {
1654  if (I.isVirtual())
1655  OS << "virtual ";
1656  dumpAccessSpecifier(I.getAccessSpecifier());
1657  dumpType(I.getType());
1658  if (I.isPackExpansion())
1659  OS << "...";
1660  });
1661  }
1662 }
1663 
1665  dumpName(D);
1666 }
1667 
1669  dumpName(D);
1670 }
1671 
1673  dumpName(D);
1674 }
1675 
1677  dumpName(D);
1678 }
1679 
1681  if (D->wasDeclaredWithTypename())
1682  OS << " typename";
1683  else
1684  OS << " class";
1685  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1686  if (D->isParameterPack())
1687  OS << " ...";
1688  dumpName(D);
1689 }
1690 
1692  const NonTypeTemplateParmDecl *D) {
1693  dumpType(D->getType());
1694  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1695  if (D->isParameterPack())
1696  OS << " ...";
1697  dumpName(D);
1698 }
1699 
1701  const TemplateTemplateParmDecl *D) {
1702  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1703  if (D->isParameterPack())
1704  OS << " ...";
1705  dumpName(D);
1706 }
1707 
1709  OS << ' ';
1710  if (D->getQualifier())
1712  OS << D->getNameAsString();
1713 }
1714 
1716  const UnresolvedUsingTypenameDecl *D) {
1717  OS << ' ';
1718  if (D->getQualifier())
1720  OS << D->getNameAsString();
1721 }
1722 
1724  const UnresolvedUsingValueDecl *D) {
1725  OS << ' ';
1726  if (D->getQualifier())
1728  OS << D->getNameAsString();
1729  dumpType(D->getType());
1730 }
1731 
1733  OS << ' ';
1735 }
1736 
1738  const ConstructorUsingShadowDecl *D) {
1739  if (D->constructsVirtualBase())
1740  OS << " virtual";
1741 
1742  AddChild([=] {
1743  OS << "target ";
1745  });
1746 
1747  AddChild([=] {
1748  OS << "nominated ";
1750  OS << ' ';
1752  });
1753 
1754  AddChild([=] {
1755  OS << "constructed ";
1757  OS << ' ';
1759  });
1760 }
1761 
1763  switch (D->getLanguage()) {
1765  OS << " C";
1766  break;
1768  OS << " C++";
1769  break;
1770  }
1771 }
1772 
1774  OS << ' ';
1776 }
1777 
1779  if (TypeSourceInfo *T = D->getFriendType())
1780  dumpType(T->getType());
1781 }
1782 
1784  dumpName(D);
1785  dumpType(D->getType());
1786  if (D->getSynthesize())
1787  OS << " synthesize";
1788 
1789  switch (D->getAccessControl()) {
1790  case ObjCIvarDecl::None:
1791  OS << " none";
1792  break;
1793  case ObjCIvarDecl::Private:
1794  OS << " private";
1795  break;
1797  OS << " protected";
1798  break;
1799  case ObjCIvarDecl::Public:
1800  OS << " public";
1801  break;
1802  case ObjCIvarDecl::Package:
1803  OS << " package";
1804  break;
1805  }
1806 }
1807 
1809  if (D->isInstanceMethod())
1810  OS << " -";
1811  else
1812  OS << " +";
1813  dumpName(D);
1814  dumpType(D->getReturnType());
1815 
1816  if (D->isVariadic())
1817  OS << " variadic";
1818 }
1819 
1821  dumpName(D);
1822  switch (D->getVariance()) {
1824  break;
1825 
1827  OS << " covariant";
1828  break;
1829 
1831  OS << " contravariant";
1832  break;
1833  }
1834 
1835  if (D->hasExplicitBound())
1836  OS << " bounded";
1838 }
1839 
1841  dumpName(D);
1844  for (const auto *P : D->protocols())
1845  dumpDeclRef(P);
1846 }
1847 
1849  dumpName(D);
1852 }
1853 
1855  dumpName(D);
1856 
1857  for (const auto *Child : D->protocols())
1858  dumpDeclRef(Child);
1859 }
1860 
1862  dumpName(D);
1863  dumpDeclRef(D->getSuperClass(), "super");
1864 
1866  for (const auto *Child : D->protocols())
1867  dumpDeclRef(Child);
1868 }
1869 
1871  const ObjCImplementationDecl *D) {
1872  dumpName(D);
1873  dumpDeclRef(D->getSuperClass(), "super");
1875 }
1876 
1878  const ObjCCompatibleAliasDecl *D) {
1879  dumpName(D);
1881 }
1882 
1884  dumpName(D);
1885  dumpType(D->getType());
1886 
1888  OS << " required";
1890  OS << " optional";
1891 
1893  if (Attrs != ObjCPropertyDecl::OBJC_PR_noattr) {
1895  OS << " readonly";
1897  OS << " assign";
1899  OS << " readwrite";
1901  OS << " retain";
1902  if (Attrs & ObjCPropertyDecl::OBJC_PR_copy)
1903  OS << " copy";
1905  OS << " nonatomic";
1907  OS << " atomic";
1908  if (Attrs & ObjCPropertyDecl::OBJC_PR_weak)
1909  OS << " weak";
1911  OS << " strong";
1913  OS << " unsafe_unretained";
1914  if (Attrs & ObjCPropertyDecl::OBJC_PR_class)
1915  OS << " class";
1917  dumpDeclRef(D->getGetterMethodDecl(), "getter");
1919  dumpDeclRef(D->getSetterMethodDecl(), "setter");
1920  }
1921 }
1922 
1924  dumpName(D->getPropertyDecl());
1926  OS << " synthesize";
1927  else
1928  OS << " dynamic";
1931 }
1932 
1934  if (D->isVariadic())
1935  OS << " variadic";
1936 
1937  if (D->capturesCXXThis())
1938  OS << " captures_this";
1939 }
1940 
1942  dumpName(D);
1943 }
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
Definition: DeclCXX.h:2415
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1107
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node)
bool path_empty() const
Definition: Expr.h:3190
void VisitVarTemplateDecl(const VarTemplateDecl *D)
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3337
Represents a function declaration or definition.
Definition: Decl.h:1748
static const TerminalColor StmtColor
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1254
void VisitGenericSelectionExpr(const GenericSelectionExpr *E)
bool getValue() const
Definition: ExprObjC.h:97
bool isVarArgParam() const LLVM_READONLY
Definition: Comment.h:776
The receiver is an object instance.
Definition: ExprObjC.h:1101
void VisitCXXDeleteExpr(const CXXDeleteExpr *Node)
protocol_range protocols() const
Definition: DeclObjC.h:1365
A class which contains all the information about a particular captured value.
Definition: Decl.h:3897
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:759
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Definition: Type.h:4145
void VisitIfStmt(const IfStmt *Node)
StringRef getArgText(unsigned Idx) const
Definition: Comment.h:672
A (possibly-)qualified type.
Definition: Type.h:643
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
const char * getDeclKindName() const
Definition: DeclBase.cpp:122
base_class_range bases()
Definition: DeclCXX.h:825
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2889
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:896
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2324
Selector getSelector() const
Definition: ExprObjC.cpp:337
void VisitCXXConstructExpr(const CXXConstructExpr *Node)
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2826
bool isSuperReceiver() const
Definition: ExprObjC.h:776
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition: Stmt.h:1882
static void dumpPreviousDeclImpl(raw_ostream &OS,...)
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3350
bool isPositionValid() const LLVM_READONLY
Definition: Comment.h:842
void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D)
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:519
Stmt - This represents one statement.
Definition: Stmt.h:66
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:25
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3378
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1812
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:900
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:2819
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1019
Represents the declaration of a typedef-name via the &#39;typedef&#39; type specifier.
Definition: Decl.h:3051
void VisitOMPRequiresDecl(const OMPRequiresDecl *D)
bool isDecltypeAuto() const
Definition: Type.h:4819
void VisitPredefinedExpr(const PredefinedExpr *Node)
void VisitCompoundAssignOperator(const CompoundAssignOperator *Node)
void VisitFriendDecl(const FriendDecl *D)
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1193
TagDecl * getDecl() const
Definition: Type.cpp:3272
void VisitObjCProtocolExpr(const ObjCProtocolExpr *Node)
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:717
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
bool isNothrow() const
Definition: Decl.cpp:4621
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2124
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Definition: DeclCXX.h:245
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2943
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3439
Represents a C++11 auto or C++14 decltype(auto) type.
Definition: Type.h:4808
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
void VisitCaseStmt(const CaseStmt *Node)
The base class of the type hierarchy.
Definition: Type.h:1421
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1442
void VisitCastExpr(const CastExpr *Node)
The parameter is covariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant and ...
Declaration of a variable template.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:2835
void VisitImportDecl(const ImportDecl *D)
Represent a C++ namespace.
Definition: Decl.h:514
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1331
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:845
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
Definition: TypeVisitor.h:68
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:112
StringRef getParamName(const FullComment *FC) const
Definition: Comment.cpp:356
A container of type source information.
Definition: Decl.h:86
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition: Stmt.h:2075
IdentKind getIdentKind() const
Definition: Expr.h:1921
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node)
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:4628
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2574
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4325
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2014
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class...
Definition: DeclCXX.h:1010
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
static const TerminalColor ObjectKindColor
This name appears in an unevaluated operand.
Definition: Specifiers.h:163
void dumpSourceRange(SourceRange R)
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3202
Represents a #pragma comment line.
Definition: Decl.h:139
void VisitSizeOfPackExpr(const SizeOfPackExpr *Node)
void VisitTypedefDecl(const TypedefDecl *D)
const CXXBaseSpecifier *const * path_const_iterator
Definition: Expr.h:3189
unsigned getDepth() const
Get the nesting depth of the template parameter.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
Definition: DeclFriend.h:53
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
Definition: Specifiers.h:155
Represents a variable declaration or definition.
Definition: Decl.h:812
StringRef getArgText(unsigned Idx) const
Definition: Comment.h:360
void VisitTagType(const TagType *T)
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:3562
const T * getAs() const
Member-template getAs<specific type>&#39;.
Definition: Type.h:6824
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2019
void VisitExtVectorElementExpr(const ExtVectorElementExpr *Node)
Extra information about a function prototype.
Definition: Type.h:3790
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:138
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition: Stmt.h:2072
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitVectorType(const VectorType *T)
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
DeclarationName getName() const
Gets the name looked up.
Definition: ExprCXX.h:2859
bool isConst() const
Definition: Type.h:3653
const char * getName() const
Definition: Stmt.cpp:340
bool isInvalidDecl() const
Definition: DeclBase.h:553
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3011
Not a TLS variable.
Definition: Decl.h:829
Describes how types, statements, expressions, and declarations should be printed. ...
Definition: PrettyPrinter.h:37
unsigned getIndex(unsigned Depth) const
Definition: Comment.h:851
protocol_range protocols() const
Definition: DeclObjC.h:2128
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
Definition: ExprCXX.h:3212
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
void VisitBindingDecl(const BindingDecl *D)
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2688
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:707
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitTemplateSpecializationType(const TemplateSpecializationType *T)
Information about a single command.
const char * getStmtClassName() const
Definition: Stmt.cpp:74
SourceLocation getAttributeLoc() const
Definition: Type.h:3168
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1710
Represents a struct/union/class.
Definition: Decl.h:3626
void VisitCXXNamedCastExpr(const CXXNamedCastExpr *Node)
clauselist_range clauselists()
Definition: DeclOpenMP.h:390
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2996
void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D)
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:297
const char * getOpenMPClauseName(OpenMPClauseKind Kind)
Definition: OpenMPKinds.cpp:62
Provides common interface for the Decls that can be redeclared.
Definition: Redeclarable.h:84
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *Node)
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:123
unsigned getDepth() const
Retrieve the depth of the template parameter.
QualType getComputationResultType() const
Definition: Expr.h:3650
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user...
Definition: Attr.h:101
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
A vector component is an element or range of elements on a vector.
Definition: Specifiers.h:146
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:575
is ARM Neon vector
Definition: Type.h:3207
RenderKind getRenderKind() const
Definition: Comment.h:352
Used for GCC&#39;s __alignof.
Definition: TypeTraits.h:106
The parameter is contravariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant ...
bool isSpelledAsLValue() const
Definition: Type.h:2712
void VisitPackTemplateArgument(const TemplateArgument &TA)
Represents a member of a struct/union/class.
Definition: Decl.h:2607
void VisitEnumConstantDecl(const EnumConstantDecl *D)
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:4965
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
Definition: DeclCXX.h:2476
void VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D)
StringRef getText() const LLVM_READONLY
Definition: Comment.h:883
StringRef getValue() const
Definition: Decl.h:197
void VisitTypeAliasDecl(const TypeAliasDecl *D)
InitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:173
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:924
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:31
void VisitFunctionProtoType(const FunctionProtoType *T)
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:417
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5479
Represents an access specifier followed by colon &#39;:&#39;.
Definition: DeclCXX.h:132
void VisitUsingDecl(const UsingDecl *D)
Describes a module or submodule.
Definition: Module.h:64
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:124
Selector getSelector() const
Definition: ExprObjC.h:467
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
StringRef getOpcodeStr() const
Definition: Expr.h:3460
void VisitSwitchStmt(const SwitchStmt *Node)
A command with word-like arguments that is considered inline content.
Definition: Comment.h:298
Describes an C or C++ initializer list.
Definition: Expr.h:4370
Represents a C++ using-declaration.
Definition: DeclCXX.h:3488
void VisitRecordDecl(const RecordDecl *D)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *Node)
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:170
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4156
AssociationTy< true > ConstAssociation
Definition: Expr.h:5355
void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D)
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1377
A line of text contained in a verbatim block.
Definition: Comment.h:863
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition: ExprObjC.h:744
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2305
void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D)
std::string getFullModuleName(bool AllowStringLiterals=false) const
Retrieve the full name of this module, including the path from its top-level module.
Definition: Module.cpp:213
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1409
bool isGlobalNew() const
Definition: ExprCXX.h:2165
A verbatim line command.
Definition: Comment.h:943
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node)
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:2880
An x-value expression is a reference to an object with independent storage but which can be "moved"...
Definition: Specifiers.h:133
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:4950
path_iterator path_begin()
Definition: Expr.h:3192
PropertyAttributeKind getPropertyAttributes() const
Definition: DeclObjC.h:839
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node)
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:657
bool isByRef() const
Whether this is a "by ref" capture, i.e.
Definition: Decl.h:3922
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:1847
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3404
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition: Expr.h:2063
Any part of the comment.
Definition: Comment.h:52
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node)
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition: Stmt.h:1885
CXXRecordDecl * getDecl() const
Definition: Type.cpp:3362
bool isArrow() const
Definition: Expr.h:2990
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1386
static const TerminalColor DeclNameColor
void VisitTemplateTypeParmType(const TemplateTypeParmType *T)
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
static const TerminalColor LocationColor
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
CaseStmt - Represent a case statement.
Definition: Stmt.h:1478
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool isAnyMemberInitializer() const
Definition: DeclCXX.h:2423
void dumpLocation(SourceLocation Loc)
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3120
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2063
unsigned getParamIndex() const LLVM_READONLY
Definition: Comment.h:785
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1282
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
Definition: DeclBase.h:828
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
FieldDecl * getAnyMember() const
Definition: DeclCXX.h:2488
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:932
void * getAsOpaquePtr() const
Definition: Type.h:688
void VisitLabelStmt(const LabelStmt *Node)
An ordinary object is located at an address in memory.
Definition: Specifiers.h:140
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:618
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3417
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4084
Represents an ObjC class declaration.
Definition: DeclObjC.h:1171
This is an odr-use.
Definition: Specifiers.h:161
Represents a linkage specification.
Definition: DeclCXX.h:2962
QualType getReturnType() const
Definition: DeclObjC.h:322
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
is ARM Neon polynomial vector
Definition: Type.h:3210
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
Definition: Type.h:3776
SplitQualType getSplitDesugaredType() const
Definition: Type.h:947
A binding in a decomposition declaration.
Definition: DeclCXX.h:3931
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3151
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
param_iterator param_begin()
Definition: Decl.h:2301
Represents the this expression in C++.
Definition: ExprCXX.h:1006
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4233
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:576
StringRef getArg() const
Definition: Decl.h:164
bool isArrayForm() const
Definition: ExprCXX.h:2292
static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)
Determine whether a type is permitted to be passed or returned in registers, per C++ [class...
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2758
#define FLAG(fn, name)
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
Definition: Expr.h:3330
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Definition: Redeclarable.h:318
A verbatim block command (e.
Definition: Comment.h:891
void VisitInjectedClassNameType(const InjectedClassNameType *T)
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:4388
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
StringRef getText() const LLVM_READONLY
Definition: Comment.h:282
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1433
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3071
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
Definition: ASTContext.h:976
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3710
void VisitImplicitCastExpr(const ImplicitCastExpr *Node)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1403
QualType getComputationLHSType() const
Definition: Expr.h:3647
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
Definition: OpenMPClause.h:78
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
Definition: DeclCXX.h:2443
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2342
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Node)
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:948
void VisitCXXRecordDecl(const CXXRecordDecl *D)
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:152
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:263
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1097
This represents &#39;#pragma omp requires...&#39; directive.
Definition: DeclOpenMP.h:345
unsigned getValue() const
Definition: Expr.h:1534
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
Definition: Specifiers.h:150
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3049
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:145
static const TerminalColor ValueColor
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2377
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3376
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3891
static const TerminalColor CommentColor
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:636
StringRef getKindName() const
Definition: Decl.h:3272
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
bool isDefaulted() const
Whether this function is defaulted per C++0x.
Definition: Decl.h:2048
bool isInvalid() const
Return true if this object is invalid or uninitialized.
std::string Label
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3556
Declaration of a template type parameter.
unsigned getIndex() const
Definition: Type.h:4625
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why? This is only meaningful if the named memb...
Definition: Expr.h:3030
void VisitObjCSelectorExpr(const ObjCSelectorExpr *Node)
unsigned getLine() const
Return the presumed line number of this location.
void VisitOMPExecutableDirective(const OMPExecutableDirective *D)
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:166
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *Node)
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:558
TextNodeDumper(raw_ostream &OS, bool ShowColors, const SourceManager *SM, const PrintingPolicy &PrintPolicy, const comments::CommandTraits *Traits)
const char * getTypeClassName() const
Definition: Type.cpp:2733
QualType getArgumentType() const
Definition: Expr.h:2379
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:596
DeclContext * getDeclContext()
Definition: DeclBase.h:438
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:337
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
TLSKind getTLSKind() const
Definition: Decl.cpp:1970
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3997
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2366
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
Definition: DeclCXX.h:3443
IdentifierInfo & getAccessor() const
Definition: Expr.h:5501
void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D)
decls_iterator decls_begin() const
Definition: ExprCXX.h:2842
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3459
bool isOMPStructuredBlock() const
Definition: Stmt.h:1093
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:582
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
Definition: Type.cpp:1875
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
QualType getType() const
Definition: Expr.h:137
static const TerminalColor ValueKindColor
StorageClass
Storage classes.
Definition: Specifiers.h:234
A unary type transform, which is a type constructed from another.
Definition: Type.h:4348
void VisitGotoStmt(const GotoStmt *Node)
void dump(raw_ostream &OS) const
Debugging aid that dumps the template name.
Direct list-initialization (C++11)
Definition: Decl.h:823
Qualifiers Quals
The local qualifiers.
Definition: Type.h:587
bool isDirectionExplicit() const LLVM_READONLY
Definition: Comment.h:749
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1772
LabelDecl * getLabel() const
Definition: Stmt.h:2468
QualType getEncodedType() const
Definition: ExprObjC.h:428
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:950
void VisitTypedefType(const TypedefType *T)
Represents an unpacked "presumed" location which can be presented to the user.
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:712
SourceLocation getEnd() const
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:2016
bool isInstanceMethod() const
Definition: DeclObjC.h:421
void dumpBareType(QualType T, bool Desugar=true)
Represents a GCC generic vector type.
Definition: Type.h:3191
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
An opening HTML tag with attributes.
Definition: Comment.h:413
ArraySizeModifier getSizeModifier() const
Definition: Type.h:2872
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
UTTKind getUTTKind() const
Definition: Type.h:4376
StringRef getName() const
Definition: Decl.h:196
ValueDecl * getDecl()
Definition: Expr.h:1217
void VisitPragmaCommentDecl(const PragmaCommentDecl *D)
Selector getSelector() const
Definition: DeclObjC.h:320
std::string getAsString() const
static QualType Desugar(ASTContext &Context, QualType QT, bool &ShouldAKA)
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition: Decl.h:2040
void VisitExprWithCleanups(const ExprWithCleanups *Node)
bool isNull() const
Return true if this QualType doesn&#39;t point to a type yet.
Definition: Type.h:708
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1283
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
void VisitFloatingLiteral(const FloatingLiteral *Node)
QualType getType() const
Definition: DeclObjC.h:828
bool getValue() const
Definition: ExprCXX.h:566
const SourceManager & SM
Definition: Format.cpp:1607
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
static const char * getDirectionAsString(PassDirection D)
Definition: Comment.cpp:177
void VisitConstructorUsingShadowDecl(const ConstructorUsingShadowDecl *D)
void VisitCapturedDecl(const CapturedDecl *D)
APValue getAPValueResult() const
Definition: Expr.cpp:345
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3842
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *D)
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6141
const char * getFilename() const
Return the presumed filename of this location.
This class provides information about commands that can be used in comments.
void VisitIndirectFieldDecl(const IndirectFieldDecl *D)
is AltiVec &#39;vector Pixel&#39;
Definition: Type.h:3201
static StringRef getIdentKindName(IdentKind IK)
Definition: Expr.cpp:640
not a target-specific vector type
Definition: Type.h:3195
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:3766
bool isImplicitProperty() const
Definition: ExprObjC.h:704
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Definition: Redeclarable.h:203
void VisitNullTemplateArgument(const TemplateArgument &TA)
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:3923
unsigned getColumn() const
Return the presumed column number of this location.
bool isParameterPack() const
Returns whether this is a parameter pack.
Encodes a location in the source.
bool getSynthesize() const
Definition: DeclObjC.h:1990
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.h:5812
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
bool isPure() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2023
void VisitDependentSizedArrayType(const DependentSizedArrayType *T)
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition: Stmt.h:2247
This represents &#39;#pragma omp declare reduction ...&#39; directive.
Definition: DeclOpenMP.h:102
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3752
void dumpPointer(const void *Ptr)
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:312
void VisitFixedPointLiteral(const FixedPointLiteral *Node)
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:5799
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2112
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D)
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:32
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
Definition: Decl.h:291
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:2005
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the &#39;typename&#39; keyword.
SourceRange getSourceRange() const LLVM_READONLY
Definition: Comment.h:215
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:376
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2063
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
bool isParamIndexValid() const LLVM_READONLY
Definition: Comment.h:772
Represents the declaration of a label.
Definition: Decl.h:468
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3707
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *Node)
static void dumpBasePath(raw_ostream &OS, const CastExpr *Node)
const CommandInfo * getCommandInfo(StringRef Name) const
bool isRestrict() const
Definition: Type.h:3655
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2114
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:302
std::string getValueAsString(unsigned Radix) const
Definition: Expr.cpp:949
void VisitMemberExpr(const MemberExpr *Node)
void VisitCallExpr(const CallExpr *Node)
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:2059
No ref-qualifier was provided.
Definition: Type.h:1374
C-style initialization with assignment.
Definition: Decl.h:817
const char * getNameStart() const
Return the beginning of the actual null-terminated string for this identifier.
This file defines OpenMP nodes for declarative directives.
bool isParameterPack() const
Definition: Type.h:4626
bool isLiteral(TokenKind K)
Return true if this is a "literal" kind, like a numeric constant, string, etc.
Definition: TokenKinds.h:85
void VisitBlockDecl(const BlockDecl *D)
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2279
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:50
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2373
bool isArray() const
Definition: ExprCXX.h:2129
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3553
static const TerminalColor NullColor
void VisitVarDecl(const VarDecl *D)
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:503
StringRef getParamNameAsWritten() const
Definition: Comment.h:834
is AltiVec &#39;vector bool ...&#39;
Definition: Type.h:3204
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don&#39;t have an explicit ini...
Definition: DeclCXX.h:3449
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:728
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3244
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:702
void dumpDeclRef(const Decl *D, StringRef Label={})
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition: ExprObjC.h:737
is AltiVec vector
Definition: Type.h:3198
PassDirection getDirection() const LLVM_READONLY
Definition: Comment.h:745
void VisitCXXNewExpr(const CXXNewExpr *Node)
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:2876
Used for C&#39;s _Alignof and C++&#39;s alignof.
Definition: TypeTraits.h:100
void VisitVariableArrayType(const VariableArrayType *T)
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
Definition: DeclBase.cpp:397
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2715
VarDecl * getVariable() const
The variable being captured.
Definition: Decl.h:3918
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:300
void printPretty(raw_ostream &OS, const ASTContext &Ctx, QualType Ty) const
Definition: APValue.cpp:459
void VisitInitListExpr(const InitListExpr *ILE)
void VisitFieldDecl(const FieldDecl *D)
A closing HTML tag.
Definition: Comment.h:507
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1380
SourceRange getBracketsRange() const
Definition: Type.h:3077
void VisitPackExpansionType(const PackExpansionType *T)
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
bool isArgumentType() const
Definition: Expr.h:2378
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1548
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Definition: Type.h:5441
bool isPartOfExplicitCast() const
Definition: Expr.h:3263
std::string getAsString() const
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2102
void VisitObjCEncodeExpr(const ObjCEncodeExpr *Node)
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4189
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:799
protocol_range protocols() const
Definition: DeclObjC.h:2355
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1341
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5039
Represents a pack expansion of types.
Definition: Type.h:5416
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3624
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:1922
void VisitArrayType(const ArrayType *T)
Represents a C11 generic selection.
Definition: Expr.h:5195
SourceRange getRange() const
Definition: Attr.h:94
void VisitIntegerLiteral(const IntegerLiteral *Node)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3877
ast_type_traits::DynTypedNode Node
void dumpAccessSpecifier(AccessSpecifier AS)
TLS with a dynamic initializer.
Definition: Decl.h:835
Represents a template argument.
Definition: TemplateBase.h:50
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:586
bool isDeduced() const
Definition: Type.h:4797
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:169
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2439
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2670
Dataflow Directional Tag Classes.
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5375
ExtInfo getExtInfo() const
Definition: Type.h:3647
not evaluated yet, for special member function
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1873
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1271
static const TerminalColor AttrColor
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2265
bool isNested() const
Whether this is a nested capture, i.e.
Definition: Decl.h:3934
bool isVariadic() const
Definition: Decl.h:3966
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2822
bool isImplicit() const
Definition: ExprCXX.h:1027
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition: Stmt.h:1879
Represents a field injected from an anonymous union/struct into the parent scope. ...
Definition: Decl.h:2858
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
QualType getUnderlyingType() const
Definition: Decl.h:3004
AccessSpecifier getAccess() const
Definition: DeclBase.h:473
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2701
unsigned getIndex() const
Retrieve the index of the template parameter.
bool usesADL() const
Definition: Expr.h:2643
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3563
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3803
bool isImplicit() const
Definition: OpenMPClause.h:80
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:558
VectorKind getVectorKind() const
Definition: Type.h:3236
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
Definition: Type.h:979
Kind getKind() const
Definition: DeclBase.h:432
void VisitUnresolvedUsingType(const UnresolvedUsingType *T)
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1422
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
Definition: DeclCXX.cpp:2365
void VisitDeclRefExpr(const DeclRefExpr *Node)
Represents an enum.
Definition: Decl.h:3359
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack...
Definition: Decl.cpp:2420
void VisitObjCMessageExpr(const ObjCMessageExpr *Node)
SourceLocation getBeginLoc() const
Returns the starting location of the clause.
Definition: OpenMPClause.h:66
void VisitUsingShadowDecl(const UsingShadowDecl *D)
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2746
llvm::APInt getValue() const
Definition: Expr.h:1400
LabelDecl * getLabel() const
Definition: Expr.h:3899
void VisitTypeTemplateArgument(const TemplateArgument &TA)
SourceLocation getEndLoc() const
Returns the ending location of the clause.
Definition: OpenMPClause.h:69
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition: ExprObjC.h:1279
path_iterator path_end()
Definition: Expr.h:3193
StringRef getTagName() const LLVM_READONLY
Definition: Comment.h:395
void VisitAddrLabelExpr(const AddrLabelExpr *Node)
SwitchStmt - This represents a &#39;switch&#39; stmt.
Definition: Stmt.h:2017
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class...
Definition: DeclCXX.h:1100
void Visit(const comments::Comment *C, const comments::FullComment *FC)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2551
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition: Type.h:3780
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
Definition: Redeclarable.h:312
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4429
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *Node)
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
void VisitFunctionType(const FunctionType *T)
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2346
unsigned getNumObjects() const
Definition: ExprCXX.h:3243
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:407
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:1830
void VisitConstantArrayType(const ConstantArrayType *T)
static void dumpPreviousDecl(raw_ostream &OS, const Decl *D)
Dump the previous declaration in the redeclaration chain for a declaration, if any.
static const TerminalColor CastColor
const llvm::APInt & getSize() const
Definition: Type.h:2913
static const TerminalColor TypeColor
Opcode getOpcode() const
Definition: Expr.h:2041
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:2696
static const TerminalColor DeclKindNameColor
SourceRange getBracketsRange() const
Definition: Type.h:3020
static const char * getCastKindName(CastKind CK)
Definition: Expr.cpp:1876
bool isVolatile() const
Definition: Type.h:3654
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *Node)
bool isArrow() const
Determine whether this member expression used the &#39;->&#39; operator; otherwise, it used the &#39;...
Definition: ExprCXX.h:3524
Represents a base class of a C++ class.
Definition: DeclCXX.h:192
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:143
void VisitCharacterLiteral(const CharacterLiteral *Node)
void VisitConceptDecl(const ConceptDecl *D)
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
bool capturesCXXThis() const
Definition: Decl.h:4023
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3296
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2455
void VisitBinaryOperator(const BinaryOperator *Node)
TypedefNameDecl * getDecl() const
Definition: Type.h:4191
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
unsigned getDepth() const
Definition: Type.h:4624
bool isFreeIvar() const
Definition: ExprObjC.h:585
Call-style initialization (C++98)
Definition: Decl.h:820
void dumpName(const NamedDecl *ND)
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2806
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:2682
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls. ...
Represents a C++ struct/union/class.
Definition: DeclCXX.h:300
const char * getCommentKindName() const
Definition: Comment.cpp:20
bool isValid() const
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
Definition: Decl.h:1329
void VisitUnaryTransformType(const UnaryTransformType *T)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
Definition: ExprCXX.h:1597
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1944
There is no such object (it&#39;s outside its lifetime).
Definition: APValue.h:82
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2200
void dumpBareDeclRef(const Decl *D)
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:3245
bool isInherited() const
Definition: Attr.h:97
const Attribute & getAttr(unsigned Idx) const
Definition: Comment.h:476
Declaration of a class template.
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitLinkageSpecDecl(const LinkageSpecDecl *D)
bool isVariadic() const
Definition: DeclObjC.h:426
The receiver is a class.
Definition: ExprObjC.h:1098
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition: Stmt.cpp:251
bool isGlobalDelete() const
Definition: ExprCXX.h:2291
void VisitObjCInterfaceType(const ObjCInterfaceType *T)
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1681
void dumpType(QualType T)
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2516
TLS with a known-constant initializer.
Definition: Decl.h:832
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3513
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition: Decl.h:275
void VisitEnumDecl(const EnumDecl *D)
StringRef getParamNameAsWritten() const
Definition: Comment.h:764
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3531
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration&#39;s cl...
Definition: DeclCXX.h:3468
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:262
unsigned getNumElements() const
Definition: Type.h:3227
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:85
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2096
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:256
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1141
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:4902
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2817
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:601
Doxygen \param command.
Definition: Comment.h:711
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2163
void VisitAccessSpecDecl(const AccessSpecDecl *D)
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast", "reinterpret_cast", or "const_cast".
Definition: ExprCXX.cpp:687
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4482
bool isArraySubscriptRefExpr() const
Definition: ExprObjC.h:904
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3331
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:2913
QualType getType() const
Definition: Decl.h:647
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:128
void VisitNamespaceDecl(const NamespaceDecl *D)
void VisitAutoType(const AutoType *T)
void VisitConstantExpr(const ConstantExpr *Node)
static const TerminalColor AddressColor
A trivial tuple used to represent a source range.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
Definition: DeclBase.h:607
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to...
Definition: Expr.cpp:1285
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:921
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:2809
This represents a decl that may have a name.
Definition: Decl.h:248
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:554
StringRef getParamName(const FullComment *FC) const
Definition: Comment.cpp:363
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:2994
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
Represents a C++ namespace alias.
Definition: DeclCXX.h:3156
APValue::ValueKind getResultAPValueKind() const
Definition: Expr.h:1020
void VisitCXXThisExpr(const CXXThisExpr *Node)
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1368
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Definition: TemplateBase.h:280
AccessControl getAccessControl() const
Definition: DeclObjC.h:1983
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Node)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
Represents C++ using-directive.
Definition: DeclCXX.h:3052
Represents a #pragma detect_mismatch line.
Definition: Decl.h:173
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
double getValueAsApproximateDouble() const
getValueAsApproximateDouble - This returns the value as an inaccurate double.
Definition: Expr.cpp:988
attr::Kind getKind() const
Definition: Attr.h:86
The receiver is a superclass.
Definition: ExprObjC.h:1104
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Definition: TemplateBase.h:287
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Definition: Decl.cpp:3138
bool hasInit() const
Definition: Decl.cpp:2198
SourceLocation getBegin() const
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4068
decls_iterator decls_end() const
Definition: ExprCXX.h:2845
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Definition: DeclObjC.h:2498
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ...
Definition: Stmt.h:1547
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2895
This class handles loading and caching of source files into memory.
The parameter is invariant: must match exactly.
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:3796
void VisitUnaryOperator(const UnaryOperator *Node)
void VisitLabelDecl(const LabelDecl *D)
Declaration of a template function.
void AddChild(Fn DoAddChild)
Add a child of the current node. Calls DoAddChild without arguments.
void VisitFunctionDecl(const FunctionDecl *D)
Attr - This represents one attribute.
Definition: Attr.h:43
bool isDeletedAsWritten() const
Definition: Decl.h:2167
SourceLocation getLocation() const
Definition: DeclBase.h:429
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D)
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Definition: DeclCXX.h:3275
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1091
QualType getType() const
Return the type wrapped by this type source info.
Definition: Decl.h:97
void VisitObjCBoxedExpr(const ObjCBoxedExpr *Node)
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3252
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:162
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2728
bool param_empty() const
Definition: Decl.h:2300
static const TerminalColor UndeserializedColor
void VisitWhileStmt(const WhileStmt *Node)
void VisitStringLiteral(const StringLiteral *Str)
QualType getType() const
Retrieves the type of the base class.
Definition: DeclCXX.h:291
void VisitRValueReferenceType(const ReferenceType *T)