clang  9.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  {
227  ColorScope Color(OS, ShowColors, DeclKindNameColor);
228  OS << D->getDeclKindName() << "Decl";
229  }
230  dumpPointer(D);
231  if (D->getLexicalDeclContext() != D->getDeclContext())
232  OS << " parent " << cast<Decl>(D->getDeclContext());
233  dumpPreviousDecl(OS, D);
235  OS << ' ';
237  if (D->isFromASTFile())
238  OS << " imported";
239  if (Module *M = D->getOwningModule())
240  OS << " in " << M->getFullModuleName();
241  if (auto *ND = dyn_cast<NamedDecl>(D))
243  const_cast<NamedDecl *>(ND)))
244  AddChild([=] { OS << "also in " << M->getFullModuleName(); });
245  if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
246  if (ND->isHidden())
247  OS << " hidden";
248  if (D->isImplicit())
249  OS << " implicit";
250 
251  if (D->isUsed())
252  OS << " used";
253  else if (D->isThisDeclarationReferenced())
254  OS << " referenced";
255 
256  if (D->isInvalidDecl())
257  OS << " invalid";
258  if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
259  if (FD->isConstexpr())
260  OS << " constexpr";
261 
262  if (!isa<FunctionDecl>(*D)) {
263  const auto *MD = dyn_cast<ObjCMethodDecl>(D);
264  if (!MD || !MD->isThisDeclarationADefinition()) {
265  const auto *DC = dyn_cast<DeclContext>(D);
266  if (DC && DC->hasExternalLexicalStorage()) {
267  ColorScope Color(OS, ShowColors, UndeserializedColor);
268  OS << " <undeserialized declarations>";
269  }
270  }
271  }
272 
274 }
275 
277  OS << "CXXCtorInitializer";
278  if (Init->isAnyMemberInitializer()) {
279  OS << ' ';
280  dumpBareDeclRef(Init->getAnyMember());
281  } else if (Init->isBaseInitializer()) {
282  dumpType(QualType(Init->getBaseClass(), 0));
283  } else if (Init->isDelegatingInitializer()) {
284  dumpType(Init->getTypeSourceInfo()->getType());
285  } else {
286  llvm_unreachable("Unknown initializer type");
287  }
288 }
289 
291  OS << "capture";
292  if (C.isByRef())
293  OS << " byref";
294  if (C.isNested())
295  OS << " nested";
296  if (C.getVariable()) {
297  OS << ' ';
299  }
300 }
301 
303  if (!C) {
304  ColorScope Color(OS, ShowColors, NullColor);
305  OS << "<<<NULL>>> OMPClause";
306  return;
307  }
308  {
309  ColorScope Color(OS, ShowColors, AttrColor);
310  StringRef ClauseName(getOpenMPClauseName(C->getClauseKind()));
311  OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
312  << ClauseName.drop_front() << "Clause";
313  }
314  dumpPointer(C);
316  if (C->isImplicit())
317  OS << " <implicit>";
318 }
319 
321  const TypeSourceInfo *TSI = A.getTypeSourceInfo();
322  if (TSI) {
323  OS << "case ";
324  dumpType(TSI->getType());
325  } else {
326  OS << "default";
327  }
328 
329  if (A.isSelected())
330  OS << " selected";
331 }
332 
333 void TextNodeDumper::dumpPointer(const void *Ptr) {
334  ColorScope Color(OS, ShowColors, AddressColor);
335  OS << ' ' << Ptr;
336 }
337 
339  if (!SM)
340  return;
341 
342  ColorScope Color(OS, ShowColors, LocationColor);
343  SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
344 
345  // The general format we print out is filename:line:col, but we drop pieces
346  // that haven't changed since the last loc printed.
347  PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
348 
349  if (PLoc.isInvalid()) {
350  OS << "<invalid sloc>";
351  return;
352  }
353 
354  if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
355  OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
356  << PLoc.getColumn();
357  LastLocFilename = PLoc.getFilename();
358  LastLocLine = PLoc.getLine();
359  } else if (PLoc.getLine() != LastLocLine) {
360  OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
361  LastLocLine = PLoc.getLine();
362  } else {
363  OS << "col" << ':' << PLoc.getColumn();
364  }
365 }
366 
368  // Can't translate locations if a SourceManager isn't available.
369  if (!SM)
370  return;
371 
372  OS << " <";
373  dumpLocation(R.getBegin());
374  if (R.getBegin() != R.getEnd()) {
375  OS << ", ";
376  dumpLocation(R.getEnd());
377  }
378  OS << ">";
379 
380  // <t2.c:123:421[blah], t2.c:412:321>
381 }
382 
384  ColorScope Color(OS, ShowColors, TypeColor);
385 
386  SplitQualType T_split = T.split();
387  OS << "'" << QualType::getAsString(T_split, PrintPolicy) << "'";
388 
389  if (Desugar && !T.isNull()) {
390  // If the type is sugared, also dump a (shallow) desugared type.
391  SplitQualType D_split = T.getSplitDesugaredType();
392  if (T_split != D_split)
393  OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
394  }
395 }
396 
398  OS << ' ';
399  dumpBareType(T);
400 }
401 
403  if (!D) {
404  ColorScope Color(OS, ShowColors, NullColor);
405  OS << "<<<NULL>>>";
406  return;
407  }
408 
409  {
410  ColorScope Color(OS, ShowColors, DeclKindNameColor);
411  OS << D->getDeclKindName();
412  }
413  dumpPointer(D);
414 
415  if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
416  ColorScope Color(OS, ShowColors, DeclNameColor);
417  OS << " '" << ND->getDeclName() << '\'';
418  }
419 
420  if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
421  dumpType(VD->getType());
422 }
423 
425  if (ND->getDeclName()) {
426  ColorScope Color(OS, ShowColors, DeclNameColor);
427  OS << ' ' << ND->getNameAsString();
428  }
429 }
430 
432  switch (AS) {
433  case AS_none:
434  break;
435  case AS_public:
436  OS << "public";
437  break;
438  case AS_protected:
439  OS << "protected";
440  break;
441  case AS_private:
442  OS << "private";
443  break;
444  }
445 }
446 
447 void TextNodeDumper::dumpCXXTemporary(const CXXTemporary *Temporary) {
448  OS << "(CXXTemporary";
449  dumpPointer(Temporary);
450  OS << ")";
451 }
452 
453 void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
454  if (!D)
455  return;
456 
457  AddChild([=] {
458  if (!Label.empty())
459  OS << Label << ' ';
460  dumpBareDeclRef(D);
461  });
462 }
463 
464 const char *TextNodeDumper::getCommandName(unsigned CommandID) {
465  if (Traits)
466  return Traits->getCommandInfo(CommandID)->Name;
467  const comments::CommandInfo *Info =
469  if (Info)
470  return Info->Name;
471  return "<not a builtin command>";
472 }
473 
475  const comments::FullComment *) {
476  OS << " Text=\"" << C->getText() << "\"";
477 }
478 
481  OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
482  switch (C->getRenderKind()) {
484  OS << " RenderNormal";
485  break;
487  OS << " RenderBold";
488  break;
490  OS << " RenderMonospaced";
491  break;
493  OS << " RenderEmphasized";
494  break;
495  }
496 
497  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
498  OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
499 }
500 
503  OS << " Name=\"" << C->getTagName() << "\"";
504  if (C->getNumAttrs() != 0) {
505  OS << " Attrs: ";
506  for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
508  OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
509  }
510  }
511  if (C->isSelfClosing())
512  OS << " SelfClosing";
513 }
514 
517  OS << " Name=\"" << C->getTagName() << "\"";
518 }
519 
522  OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
523  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
524  OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
525 }
526 
529  OS << " "
531 
532  if (C->isDirectionExplicit())
533  OS << " explicitly";
534  else
535  OS << " implicitly";
536 
537  if (C->hasParamName()) {
538  if (C->isParamIndexValid())
539  OS << " Param=\"" << C->getParamName(FC) << "\"";
540  else
541  OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
542  }
543 
544  if (C->isParamIndexValid() && !C->isVarArgParam())
545  OS << " ParamIndex=" << C->getParamIndex();
546 }
547 
550  if (C->hasParamName()) {
551  if (C->isPositionValid())
552  OS << " Param=\"" << C->getParamName(FC) << "\"";
553  else
554  OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
555  }
556 
557  if (C->isPositionValid()) {
558  OS << " Position=<";
559  for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
560  OS << C->getIndex(i);
561  if (i != e - 1)
562  OS << ", ";
563  }
564  OS << ">";
565  }
566 }
567 
570  OS << " Name=\"" << getCommandName(C->getCommandID())
571  << "\""
572  " CloseName=\""
573  << C->getCloseName() << "\"";
574 }
575 
578  const comments::FullComment *) {
579  OS << " Text=\"" << C->getText() << "\"";
580 }
581 
584  OS << " Text=\"" << C->getText() << "\"";
585 }
586 
588  OS << " null";
589 }
590 
592  OS << " type";
593  dumpType(TA.getAsType());
594 }
595 
597  const TemplateArgument &TA) {
598  OS << " decl";
599  dumpDeclRef(TA.getAsDecl());
600 }
601 
603  OS << " nullptr";
604 }
605 
607  OS << " integral " << TA.getAsIntegral();
608 }
609 
611  OS << " template ";
612  TA.getAsTemplate().dump(OS);
613 }
614 
616  const TemplateArgument &TA) {
617  OS << " template expansion ";
619 }
620 
622  OS << " expr";
623 }
624 
626  OS << " pack";
627 }
628 
629 static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
630  if (Node->path_empty())
631  return;
632 
633  OS << " (";
634  bool First = true;
635  for (CastExpr::path_const_iterator I = Node->path_begin(),
636  E = Node->path_end();
637  I != E; ++I) {
638  const CXXBaseSpecifier *Base = *I;
639  if (!First)
640  OS << " -> ";
641 
642  const CXXRecordDecl *RD =
643  cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
644 
645  if (Base->isVirtual())
646  OS << "virtual ";
647  OS << RD->getName();
648  First = false;
649  }
650 
651  OS << ')';
652 }
653 
655  if (Node->hasInitStorage())
656  OS << " has_init";
657  if (Node->hasVarStorage())
658  OS << " has_var";
659  if (Node->hasElseStorage())
660  OS << " has_else";
661 }
662 
664  if (Node->hasInitStorage())
665  OS << " has_init";
666  if (Node->hasVarStorage())
667  OS << " has_var";
668 }
669 
671  if (Node->hasVarStorage())
672  OS << " has_var";
673 }
674 
676  OS << " '" << Node->getName() << "'";
677 }
678 
680  OS << " '" << Node->getLabel()->getName() << "'";
681  dumpPointer(Node->getLabel());
682 }
683 
685  if (Node->caseStmtIsGNURange())
686  OS << " gnu_range";
687 }
688 
690  if (Node->usesADL())
691  OS << " adl";
692 }
693 
695  OS << " <";
696  {
697  ColorScope Color(OS, ShowColors, CastColor);
698  OS << Node->getCastKindName();
699  }
700  dumpBasePath(OS, Node);
701  OS << ">";
702 }
703 
705  VisitCastExpr(Node);
706  if (Node->isPartOfExplicitCast())
707  OS << " part_of_explicit_cast";
708 }
709 
711  OS << " ";
712  dumpBareDeclRef(Node->getDecl());
713  if (Node->getDecl() != Node->getFoundDecl()) {
714  OS << " (";
715  dumpBareDeclRef(Node->getFoundDecl());
716  OS << ")";
717  }
718 }
719 
721  const UnresolvedLookupExpr *Node) {
722  OS << " (";
723  if (!Node->requiresADL())
724  OS << "no ";
725  OS << "ADL) = '" << Node->getName() << '\'';
726 
728  E = Node->decls_end();
729  if (I == E)
730  OS << " empty";
731  for (; I != E; ++I)
732  dumpPointer(*I);
733 }
734 
736  {
737  ColorScope Color(OS, ShowColors, DeclKindNameColor);
738  OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
739  }
740  OS << "='" << *Node->getDecl() << "'";
741  dumpPointer(Node->getDecl());
742  if (Node->isFreeIvar())
743  OS << " isFreeIvar";
744 }
745 
747  OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
748 }
749 
751  ColorScope Color(OS, ShowColors, ValueColor);
752  OS << " " << Node->getValue();
753 }
754 
756  bool isSigned = Node->getType()->isSignedIntegerType();
757  ColorScope Color(OS, ShowColors, ValueColor);
758  OS << " " << Node->getValue().toString(10, isSigned);
759 }
760 
762  ColorScope Color(OS, ShowColors, ValueColor);
763  OS << " " << Node->getValueAsString(/*Radix=*/10);
764 }
765 
767  ColorScope Color(OS, ShowColors, ValueColor);
768  OS << " " << Node->getValueAsApproximateDouble();
769 }
770 
772  ColorScope Color(OS, ShowColors, ValueColor);
773  OS << " ";
774  Str->outputString(OS);
775 }
776 
778  if (auto *Field = ILE->getInitializedFieldInUnion()) {
779  OS << " field ";
780  dumpBareDeclRef(Field);
781  }
782 }
783 
785  if (E->isResultDependent())
786  OS << " result_dependent";
787 }
788 
790  OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
791  << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
792  if (!Node->canOverflow())
793  OS << " cannot overflow";
794 }
795 
798  switch (Node->getKind()) {
799  case UETT_SizeOf:
800  OS << " sizeof";
801  break;
802  case UETT_AlignOf:
803  OS << " alignof";
804  break;
805  case UETT_VecStep:
806  OS << " vec_step";
807  break;
809  OS << " __builtin_omp_required_simd_align";
810  break;
812  OS << " __alignof";
813  break;
814  }
815  if (Node->isArgumentType())
816  dumpType(Node->getArgumentType());
817 }
818 
820  OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
821  dumpPointer(Node->getMemberDecl());
822 }
823 
825  const ExtVectorElementExpr *Node) {
826  OS << " " << Node->getAccessor().getNameStart();
827 }
828 
830  OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
831 }
832 
834  const CompoundAssignOperator *Node) {
835  OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
836  << "' ComputeLHSTy=";
838  OS << " ComputeResultTy=";
840 }
841 
843  OS << " " << Node->getLabel()->getName();
844  dumpPointer(Node->getLabel());
845 }
846 
848  OS << " " << Node->getCastName() << "<"
849  << Node->getTypeAsWritten().getAsString() << ">"
850  << " <" << Node->getCastKindName();
851  dumpBasePath(OS, Node);
852  OS << ">";
853 }
854 
856  OS << " " << (Node->getValue() ? "true" : "false");
857 }
858 
860  if (Node->isImplicit())
861  OS << " implicit";
862  OS << " this";
863 }
864 
866  const CXXFunctionalCastExpr *Node) {
867  OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
868  << Node->getCastKindName() << ">";
869 }
870 
873  dumpType(Node->getTypeAsWritten());
874  if (Node->isListInitialization())
875  OS << " list";
876 }
877 
879  CXXConstructorDecl *Ctor = Node->getConstructor();
880  dumpType(Ctor->getType());
881  if (Node->isElidable())
882  OS << " elidable";
883  if (Node->isListInitialization())
884  OS << " list";
885  if (Node->isStdInitListInitialization())
886  OS << " std::initializer_list";
887  if (Node->requiresZeroInitialization())
888  OS << " zeroing";
889 }
890 
892  const CXXBindTemporaryExpr *Node) {
893  OS << " ";
894  dumpCXXTemporary(Node->getTemporary());
895 }
896 
898  if (Node->isGlobalNew())
899  OS << " global";
900  if (Node->isArray())
901  OS << " array";
902  if (Node->getOperatorNew()) {
903  OS << ' ';
905  }
906  // We could dump the deallocation function used in case of error, but it's
907  // usually not that interesting.
908 }
909 
911  if (Node->isGlobalDelete())
912  OS << " global";
913  if (Node->isArrayForm())
914  OS << " array";
915  if (Node->getOperatorDelete()) {
916  OS << ' ';
918  }
919 }
920 
923  if (const ValueDecl *VD = Node->getExtendingDecl()) {
924  OS << " extended by ";
925  dumpBareDeclRef(VD);
926  }
927 }
928 
930  for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
931  dumpDeclRef(Node->getObject(i), "cleanup");
932 }
933 
935  dumpPointer(Node->getPack());
936  dumpName(Node->getPack());
937 }
938 
941  OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
942 }
943 
945  OS << " selector=";
946  Node->getSelector().print(OS);
947  switch (Node->getReceiverKind()) {
949  break;
950 
952  OS << " class=";
954  break;
955 
957  OS << " super (instance)";
958  break;
959 
961  OS << " super (class)";
962  break;
963  }
964 }
965 
967  if (auto *BoxingMethod = Node->getBoxingMethod()) {
968  OS << " selector=";
969  BoxingMethod->getSelector().print(OS);
970  }
971 }
972 
974  if (!Node->getCatchParamDecl())
975  OS << " catch all";
976 }
977 
979  dumpType(Node->getEncodedType());
980 }
981 
983  OS << " ";
984  Node->getSelector().print(OS);
985 }
986 
988  OS << ' ' << *Node->getProtocol();
989 }
990 
992  if (Node->isImplicitProperty()) {
993  OS << " Kind=MethodRef Getter=\"";
994  if (Node->getImplicitPropertyGetter())
996  else
997  OS << "(null)";
998 
999  OS << "\" Setter=\"";
1000  if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1001  Setter->getSelector().print(OS);
1002  else
1003  OS << "(null)";
1004  OS << "\"";
1005  } else {
1006  OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1007  << '"';
1008  }
1009 
1010  if (Node->isSuperReceiver())
1011  OS << " super";
1012 
1013  OS << " Messaging=";
1014  if (Node->isMessagingGetter() && Node->isMessagingSetter())
1015  OS << "Getter&Setter";
1016  else if (Node->isMessagingGetter())
1017  OS << "Getter";
1018  else if (Node->isMessagingSetter())
1019  OS << "Setter";
1020 }
1021 
1023  const ObjCSubscriptRefExpr *Node) {
1024  if (Node->isArraySubscriptRefExpr())
1025  OS << " Kind=ArraySubscript GetterForArray=\"";
1026  else
1027  OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1028  if (Node->getAtIndexMethodDecl())
1029  Node->getAtIndexMethodDecl()->getSelector().print(OS);
1030  else
1031  OS << "(null)";
1032 
1033  if (Node->isArraySubscriptRefExpr())
1034  OS << "\" SetterForArray=\"";
1035  else
1036  OS << "\" SetterForDictionary=\"";
1037  if (Node->setAtIndexMethodDecl())
1038  Node->setAtIndexMethodDecl()->getSelector().print(OS);
1039  else
1040  OS << "(null)";
1041 }
1042 
1044  OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1045 }
1046 
1048  if (T->isSpelledAsLValue())
1049  OS << " written as lvalue reference";
1050 }
1051 
1053  switch (T->getSizeModifier()) {
1054  case ArrayType::Normal:
1055  break;
1056  case ArrayType::Static:
1057  OS << " static";
1058  break;
1059  case ArrayType::Star:
1060  OS << " *";
1061  break;
1062  }
1063  OS << " " << T->getIndexTypeQualifiers().getAsString();
1064 }
1065 
1067  OS << " " << T->getSize();
1068  VisitArrayType(T);
1069 }
1070 
1072  OS << " ";
1074  VisitArrayType(T);
1075 }
1076 
1078  const DependentSizedArrayType *T) {
1079  VisitArrayType(T);
1080  OS << " ";
1082 }
1083 
1085  const DependentSizedExtVectorType *T) {
1086  OS << " ";
1088 }
1089 
1091  switch (T->getVectorKind()) {
1093  break;
1095  OS << " altivec";
1096  break;
1098  OS << " altivec pixel";
1099  break;
1101  OS << " altivec bool";
1102  break;
1104  OS << " neon";
1105  break;
1107  OS << " neon poly";
1108  break;
1109  }
1110  OS << " " << T->getNumElements();
1111 }
1112 
1114  auto EI = T->getExtInfo();
1115  if (EI.getNoReturn())
1116  OS << " noreturn";
1117  if (EI.getProducesResult())
1118  OS << " produces_result";
1119  if (EI.getHasRegParm())
1120  OS << " regparm " << EI.getRegParm();
1121  OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1122 }
1123 
1125  auto EPI = T->getExtProtoInfo();
1126  if (EPI.HasTrailingReturn)
1127  OS << " trailing_return";
1128  if (T->isConst())
1129  OS << " const";
1130  if (T->isVolatile())
1131  OS << " volatile";
1132  if (T->isRestrict())
1133  OS << " restrict";
1134  if (T->getExtProtoInfo().Variadic)
1135  OS << " variadic";
1136  switch (EPI.RefQualifier) {
1137  case RQ_None:
1138  break;
1139  case RQ_LValue:
1140  OS << " &";
1141  break;
1142  case RQ_RValue:
1143  OS << " &&";
1144  break;
1145  }
1146  // FIXME: Exception specification.
1147  // FIXME: Consumed parameters.
1148  VisitFunctionType(T);
1149 }
1150 
1152  dumpDeclRef(T->getDecl());
1153 }
1154 
1156  dumpDeclRef(T->getDecl());
1157 }
1158 
1160  switch (T->getUTTKind()) {
1162  OS << " underlying_type";
1163  break;
1164  }
1165 }
1166 
1168  dumpDeclRef(T->getDecl());
1169 }
1170 
1172  OS << " depth " << T->getDepth() << " index " << T->getIndex();
1173  if (T->isParameterPack())
1174  OS << " pack";
1175  dumpDeclRef(T->getDecl());
1176 }
1177 
1179  if (T->isDecltypeAuto())
1180  OS << " decltype(auto)";
1181  if (!T->isDeduced())
1182  OS << " undeduced";
1183 }
1184 
1186  const TemplateSpecializationType *T) {
1187  if (T->isTypeAlias())
1188  OS << " alias";
1189  OS << " ";
1190  T->getTemplateName().dump(OS);
1191 }
1192 
1194  const InjectedClassNameType *T) {
1195  dumpDeclRef(T->getDecl());
1196 }
1197 
1199  dumpDeclRef(T->getDecl());
1200 }
1201 
1203  if (auto N = T->getNumExpansions())
1204  OS << " expansions " << *N;
1205 }
1206 
1208 
1210  dumpName(D);
1212  if (D->isModulePrivate())
1213  OS << " __module_private__";
1214 }
1215 
1217  if (D->isScoped()) {
1218  if (D->isScopedUsingClassTag())
1219  OS << " class";
1220  else
1221  OS << " struct";
1222  }
1223  dumpName(D);
1224  if (D->isModulePrivate())
1225  OS << " __module_private__";
1226  if (D->isFixed())
1227  dumpType(D->getIntegerType());
1228 }
1229 
1231  OS << ' ' << D->getKindName();
1232  dumpName(D);
1233  if (D->isModulePrivate())
1234  OS << " __module_private__";
1235  if (D->isCompleteDefinition())
1236  OS << " definition";
1237 }
1238 
1240  dumpName(D);
1241  dumpType(D->getType());
1242 }
1243 
1245  dumpName(D);
1246  dumpType(D->getType());
1247 
1248  for (const auto *Child : D->chain())
1249  dumpDeclRef(Child);
1250 }
1251 
1253  dumpName(D);
1254  dumpType(D->getType());
1255 
1256  StorageClass SC = D->getStorageClass();
1257  if (SC != SC_None)
1258  OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);
1259  if (D->isInlineSpecified())
1260  OS << " inline";
1261  if (D->isVirtualAsWritten())
1262  OS << " virtual";
1263  if (D->isModulePrivate())
1264  OS << " __module_private__";
1265 
1266  if (D->isPure())
1267  OS << " pure";
1268  if (D->isDefaulted()) {
1269  OS << " default";
1270  if (D->isDeleted())
1271  OS << "_delete";
1272  }
1273  if (D->isDeletedAsWritten())
1274  OS << " delete";
1275  if (D->isTrivial())
1276  OS << " trivial";
1277 
1278  if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
1279  FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
1280  switch (EPI.ExceptionSpec.Type) {
1281  default:
1282  break;
1283  case EST_Unevaluated:
1284  OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
1285  break;
1286  case EST_Uninstantiated:
1287  OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
1288  break;
1289  }
1290  }
1291 
1292  if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
1293  if (MD->size_overridden_methods() != 0) {
1294  auto dumpOverride = [=](const CXXMethodDecl *D) {
1295  SplitQualType T_split = D->getType().split();
1296  OS << D << " " << D->getParent()->getName()
1297  << "::" << D->getNameAsString() << " '"
1298  << QualType::getAsString(T_split, PrintPolicy) << "'";
1299  };
1300 
1301  AddChild([=] {
1302  auto Overrides = MD->overridden_methods();
1303  OS << "Overrides: [ ";
1304  dumpOverride(*Overrides.begin());
1305  for (const auto *Override :
1306  llvm::make_range(Overrides.begin() + 1, Overrides.end())) {
1307  OS << ", ";
1308  dumpOverride(Override);
1309  }
1310  OS << " ]";
1311  });
1312  }
1313  }
1314 
1315  // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
1316  // the Params are set later, it is possible for a dump during debugging to
1317  // encounter a FunctionDecl that has been created but hasn't been assigned
1318  // ParmVarDecls yet.
1319  if (!D->param_empty() && !D->param_begin())
1320  OS << " <<<NULL params x " << D->getNumParams() << ">>>";
1321 }
1322 
1324  dumpName(D);
1325  dumpType(D->getType());
1326  if (D->isMutable())
1327  OS << " mutable";
1328  if (D->isModulePrivate())
1329  OS << " __module_private__";
1330 }
1331 
1333  dumpName(D);
1334  dumpType(D->getType());
1335  StorageClass SC = D->getStorageClass();
1336  if (SC != SC_None)
1337  OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);
1338  switch (D->getTLSKind()) {
1339  case VarDecl::TLS_None:
1340  break;
1341  case VarDecl::TLS_Static:
1342  OS << " tls";
1343  break;
1344  case VarDecl::TLS_Dynamic:
1345  OS << " tls_dynamic";
1346  break;
1347  }
1348  if (D->isModulePrivate())
1349  OS << " __module_private__";
1350  if (D->isNRVOVariable())
1351  OS << " nrvo";
1352  if (D->isInline())
1353  OS << " inline";
1354  if (D->isConstexpr())
1355  OS << " constexpr";
1356  if (D->hasInit()) {
1357  switch (D->getInitStyle()) {
1358  case VarDecl::CInit:
1359  OS << " cinit";
1360  break;
1361  case VarDecl::CallInit:
1362  OS << " callinit";
1363  break;
1364  case VarDecl::ListInit:
1365  OS << " listinit";
1366  break;
1367  }
1368  }
1369 }
1370 
1372  dumpName(D);
1373  dumpType(D->getType());
1374 }
1375 
1377  if (D->isNothrow())
1378  OS << " nothrow";
1379 }
1380 
1382  OS << ' ' << D->getImportedModule()->getFullModuleName();
1383 
1384  for (Decl *InitD :
1386  dumpDeclRef(InitD, "initializer");
1387 }
1388 
1390  OS << ' ';
1391  switch (D->getCommentKind()) {
1392  case PCK_Unknown:
1393  llvm_unreachable("unexpected pragma comment kind");
1394  case PCK_Compiler:
1395  OS << "compiler";
1396  break;
1397  case PCK_ExeStr:
1398  OS << "exestr";
1399  break;
1400  case PCK_Lib:
1401  OS << "lib";
1402  break;
1403  case PCK_Linker:
1404  OS << "linker";
1405  break;
1406  case PCK_User:
1407  OS << "user";
1408  break;
1409  }
1410  StringRef Arg = D->getArg();
1411  if (!Arg.empty())
1412  OS << " \"" << Arg << "\"";
1413 }
1414 
1416  const PragmaDetectMismatchDecl *D) {
1417  OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
1418 }
1419 
1421  const OMPExecutableDirective *D) {
1422  if (D->isStandaloneDirective())
1423  OS << " openmp_standalone_directive";
1424 }
1425 
1427  const OMPDeclareReductionDecl *D) {
1428  dumpName(D);
1429  dumpType(D->getType());
1430  OS << " combiner";
1431  dumpPointer(D->getCombiner());
1432  if (const auto *Initializer = D->getInitializer()) {
1433  OS << " initializer";
1434  dumpPointer(Initializer);
1435  switch (D->getInitializerKind()) {
1437  OS << " omp_priv = ";
1438  break;
1440  OS << " omp_priv ()";
1441  break;
1443  break;
1444  }
1445  }
1446 }
1447 
1449  for (const auto *C : D->clauselists()) {
1450  AddChild([=] {
1451  if (!C) {
1452  ColorScope Color(OS, ShowColors, NullColor);
1453  OS << "<<<NULL>>> OMPClause";
1454  return;
1455  }
1456  {
1457  ColorScope Color(OS, ShowColors, AttrColor);
1458  StringRef ClauseName(getOpenMPClauseName(C->getClauseKind()));
1459  OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
1460  << ClauseName.drop_front() << "Clause";
1461  }
1462  dumpPointer(C);
1463  dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
1464  });
1465  }
1466 }
1467 
1469  dumpName(D);
1470  dumpType(D->getType());
1471 }
1472 
1474  dumpName(D);
1475  if (D->isInline())
1476  OS << " inline";
1477  if (!D->isOriginalNamespace())
1478  dumpDeclRef(D->getOriginalNamespace(), "original");
1479 }
1480 
1482  OS << ' ';
1484 }
1485 
1487  dumpName(D);
1489 }
1490 
1492  dumpName(D);
1494 }
1495 
1497  const TypeAliasTemplateDecl *D) {
1498  dumpName(D);
1499 }
1500 
1502  VisitRecordDecl(D);
1503  if (!D->isCompleteDefinition())
1504  return;
1505 
1506  AddChild([=] {
1507  {
1508  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1509  OS << "DefinitionData";
1510  }
1511 #define FLAG(fn, name) \
1512  if (D->fn()) \
1513  OS << " " #name;
1514  FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
1515 
1516  FLAG(isGenericLambda, generic);
1517  FLAG(isLambda, lambda);
1518 
1519  FLAG(canPassInRegisters, pass_in_registers);
1520  FLAG(isEmpty, empty);
1521  FLAG(isAggregate, aggregate);
1522  FLAG(isStandardLayout, standard_layout);
1523  FLAG(isTriviallyCopyable, trivially_copyable);
1524  FLAG(isPOD, pod);
1525  FLAG(isTrivial, trivial);
1526  FLAG(isPolymorphic, polymorphic);
1527  FLAG(isAbstract, abstract);
1528  FLAG(isLiteral, literal);
1529 
1530  FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
1531  FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
1532  FLAG(hasMutableFields, has_mutable_fields);
1533  FLAG(hasVariantMembers, has_variant_members);
1534  FLAG(allowConstDefaultInit, can_const_default_init);
1535 
1536  AddChild([=] {
1537  {
1538  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1539  OS << "DefaultConstructor";
1540  }
1541  FLAG(hasDefaultConstructor, exists);
1542  FLAG(hasTrivialDefaultConstructor, trivial);
1543  FLAG(hasNonTrivialDefaultConstructor, non_trivial);
1544  FLAG(hasUserProvidedDefaultConstructor, user_provided);
1545  FLAG(hasConstexprDefaultConstructor, constexpr);
1546  FLAG(needsImplicitDefaultConstructor, needs_implicit);
1547  FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
1548  });
1549 
1550  AddChild([=] {
1551  {
1552  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1553  OS << "CopyConstructor";
1554  }
1555  FLAG(hasSimpleCopyConstructor, simple);
1556  FLAG(hasTrivialCopyConstructor, trivial);
1557  FLAG(hasNonTrivialCopyConstructor, non_trivial);
1558  FLAG(hasUserDeclaredCopyConstructor, user_declared);
1559  FLAG(hasCopyConstructorWithConstParam, has_const_param);
1560  FLAG(needsImplicitCopyConstructor, needs_implicit);
1561  FLAG(needsOverloadResolutionForCopyConstructor,
1562  needs_overload_resolution);
1564  FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
1565  FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
1566  });
1567 
1568  AddChild([=] {
1569  {
1570  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1571  OS << "MoveConstructor";
1572  }
1573  FLAG(hasMoveConstructor, exists);
1574  FLAG(hasSimpleMoveConstructor, simple);
1575  FLAG(hasTrivialMoveConstructor, trivial);
1576  FLAG(hasNonTrivialMoveConstructor, non_trivial);
1577  FLAG(hasUserDeclaredMoveConstructor, user_declared);
1578  FLAG(needsImplicitMoveConstructor, needs_implicit);
1579  FLAG(needsOverloadResolutionForMoveConstructor,
1580  needs_overload_resolution);
1582  FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
1583  });
1584 
1585  AddChild([=] {
1586  {
1587  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1588  OS << "CopyAssignment";
1589  }
1590  FLAG(hasTrivialCopyAssignment, trivial);
1591  FLAG(hasNonTrivialCopyAssignment, non_trivial);
1592  FLAG(hasCopyAssignmentWithConstParam, has_const_param);
1593  FLAG(hasUserDeclaredCopyAssignment, user_declared);
1594  FLAG(needsImplicitCopyAssignment, needs_implicit);
1595  FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
1596  FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
1597  });
1598 
1599  AddChild([=] {
1600  {
1601  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1602  OS << "MoveAssignment";
1603  }
1604  FLAG(hasMoveAssignment, exists);
1605  FLAG(hasSimpleMoveAssignment, simple);
1606  FLAG(hasTrivialMoveAssignment, trivial);
1607  FLAG(hasNonTrivialMoveAssignment, non_trivial);
1608  FLAG(hasUserDeclaredMoveAssignment, user_declared);
1609  FLAG(needsImplicitMoveAssignment, needs_implicit);
1610  FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
1611  });
1612 
1613  AddChild([=] {
1614  {
1615  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1616  OS << "Destructor";
1617  }
1618  FLAG(hasSimpleDestructor, simple);
1619  FLAG(hasIrrelevantDestructor, irrelevant);
1620  FLAG(hasTrivialDestructor, trivial);
1621  FLAG(hasNonTrivialDestructor, non_trivial);
1622  FLAG(hasUserDeclaredDestructor, user_declared);
1623  FLAG(needsImplicitDestructor, needs_implicit);
1624  FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
1626  FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
1627  });
1628  });
1629 
1630  for (const auto &I : D->bases()) {
1631  AddChild([=] {
1632  if (I.isVirtual())
1633  OS << "virtual ";
1634  dumpAccessSpecifier(I.getAccessSpecifier());
1635  dumpType(I.getType());
1636  if (I.isPackExpansion())
1637  OS << "...";
1638  });
1639  }
1640 }
1641 
1643  dumpName(D);
1644 }
1645 
1647  dumpName(D);
1648 }
1649 
1651  dumpName(D);
1652 }
1653 
1655  dumpName(D);
1656 }
1657 
1659  if (D->wasDeclaredWithTypename())
1660  OS << " typename";
1661  else
1662  OS << " class";
1663  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1664  if (D->isParameterPack())
1665  OS << " ...";
1666  dumpName(D);
1667 }
1668 
1670  const NonTypeTemplateParmDecl *D) {
1671  dumpType(D->getType());
1672  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1673  if (D->isParameterPack())
1674  OS << " ...";
1675  dumpName(D);
1676 }
1677 
1679  const TemplateTemplateParmDecl *D) {
1680  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1681  if (D->isParameterPack())
1682  OS << " ...";
1683  dumpName(D);
1684 }
1685 
1687  OS << ' ';
1688  if (D->getQualifier())
1690  OS << D->getNameAsString();
1691 }
1692 
1694  const UnresolvedUsingTypenameDecl *D) {
1695  OS << ' ';
1696  if (D->getQualifier())
1698  OS << D->getNameAsString();
1699 }
1700 
1702  const UnresolvedUsingValueDecl *D) {
1703  OS << ' ';
1704  if (D->getQualifier())
1706  OS << D->getNameAsString();
1707  dumpType(D->getType());
1708 }
1709 
1711  OS << ' ';
1713 }
1714 
1716  const ConstructorUsingShadowDecl *D) {
1717  if (D->constructsVirtualBase())
1718  OS << " virtual";
1719 
1720  AddChild([=] {
1721  OS << "target ";
1723  });
1724 
1725  AddChild([=] {
1726  OS << "nominated ";
1728  OS << ' ';
1730  });
1731 
1732  AddChild([=] {
1733  OS << "constructed ";
1735  OS << ' ';
1737  });
1738 }
1739 
1741  switch (D->getLanguage()) {
1743  OS << " C";
1744  break;
1746  OS << " C++";
1747  break;
1748  }
1749 }
1750 
1752  OS << ' ';
1754 }
1755 
1757  if (TypeSourceInfo *T = D->getFriendType())
1758  dumpType(T->getType());
1759 }
1760 
1762  dumpName(D);
1763  dumpType(D->getType());
1764  if (D->getSynthesize())
1765  OS << " synthesize";
1766 
1767  switch (D->getAccessControl()) {
1768  case ObjCIvarDecl::None:
1769  OS << " none";
1770  break;
1771  case ObjCIvarDecl::Private:
1772  OS << " private";
1773  break;
1775  OS << " protected";
1776  break;
1777  case ObjCIvarDecl::Public:
1778  OS << " public";
1779  break;
1780  case ObjCIvarDecl::Package:
1781  OS << " package";
1782  break;
1783  }
1784 }
1785 
1787  if (D->isInstanceMethod())
1788  OS << " -";
1789  else
1790  OS << " +";
1791  dumpName(D);
1792  dumpType(D->getReturnType());
1793 
1794  if (D->isVariadic())
1795  OS << " variadic";
1796 }
1797 
1799  dumpName(D);
1800  switch (D->getVariance()) {
1802  break;
1803 
1805  OS << " covariant";
1806  break;
1807 
1809  OS << " contravariant";
1810  break;
1811  }
1812 
1813  if (D->hasExplicitBound())
1814  OS << " bounded";
1816 }
1817 
1819  dumpName(D);
1822  for (const auto *P : D->protocols())
1823  dumpDeclRef(P);
1824 }
1825 
1827  dumpName(D);
1830 }
1831 
1833  dumpName(D);
1834 
1835  for (const auto *Child : D->protocols())
1836  dumpDeclRef(Child);
1837 }
1838 
1840  dumpName(D);
1841  dumpDeclRef(D->getSuperClass(), "super");
1842 
1844  for (const auto *Child : D->protocols())
1845  dumpDeclRef(Child);
1846 }
1847 
1849  const ObjCImplementationDecl *D) {
1850  dumpName(D);
1851  dumpDeclRef(D->getSuperClass(), "super");
1853 }
1854 
1856  const ObjCCompatibleAliasDecl *D) {
1857  dumpName(D);
1859 }
1860 
1862  dumpName(D);
1863  dumpType(D->getType());
1864 
1866  OS << " required";
1868  OS << " optional";
1869 
1871  if (Attrs != ObjCPropertyDecl::OBJC_PR_noattr) {
1873  OS << " readonly";
1875  OS << " assign";
1877  OS << " readwrite";
1879  OS << " retain";
1880  if (Attrs & ObjCPropertyDecl::OBJC_PR_copy)
1881  OS << " copy";
1883  OS << " nonatomic";
1885  OS << " atomic";
1886  if (Attrs & ObjCPropertyDecl::OBJC_PR_weak)
1887  OS << " weak";
1889  OS << " strong";
1891  OS << " unsafe_unretained";
1892  if (Attrs & ObjCPropertyDecl::OBJC_PR_class)
1893  OS << " class";
1895  dumpDeclRef(D->getGetterMethodDecl(), "getter");
1897  dumpDeclRef(D->getSetterMethodDecl(), "setter");
1898  }
1899 }
1900 
1902  dumpName(D->getPropertyDecl());
1904  OS << " synthesize";
1905  else
1906  OS << " dynamic";
1909 }
1910 
1912  if (D->isVariadic())
1913  OS << " variadic";
1914 
1915  if (D->capturesCXXThis())
1916  OS << " captures_this";
1917 }
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:2332
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:3111
void VisitVarTemplateDecl(const VarTemplateDecl *D)
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3208
Represents a function declaration or definition.
Definition: Decl.h:1737
static const TerminalColor StmtColor
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1184
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:3863
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:755
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Definition: Type.h:4133
void VisitIfStmt(const IfStmt *Node)
StringRef getArgText(unsigned Idx) const
Definition: Comment.h:672
A (possibly-)qualified type.
Definition: Type.h:639
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
const char * getDeclKindName() const
Definition: DeclBase.cpp:122
base_class_range bases()
Definition: DeclCXX.h:822
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2816
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:1822
static void dumpPreviousDeclImpl(raw_ostream &OS,...)
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3334
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:65
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:3367
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1752
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:900
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:2785
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:3017
void VisitOMPRequiresDecl(const OMPRequiresDecl *D)
bool isDecltypeAuto() const
Definition: Type.h:4772
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:87
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1190
TagDecl * getDecl() const
Definition: Type.cpp:3244
void VisitObjCProtocolExpr(const ObjCProtocolExpr *Node)
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:717
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
bool isNothrow() const
Definition: Decl.cpp:4493
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2108
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Definition: DeclCXX.h:244
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:2927
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3353
Represents a C++11 auto or C++14 decltype(auto) type.
Definition: Type.h:4761
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:1414
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1430
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:2824
void VisitImportDecl(const ImportDecl *D)
Represent a C++ namespace.
Definition: Decl.h:514
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1319
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:97
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:2015
IdentKind getIdentKind() const
Definition: Expr.h:1839
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node)
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:4581
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2491
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4309
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:1999
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class...
Definition: DeclCXX.h:1007
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
static const TerminalColor ObjectKindColor
void dumpSourceRange(SourceRange R)
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3168
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:3110
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:140
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:3528
const T * getAs() const
Member-template getAs<specific type>&#39;.
Definition: Type.h:6768
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2019
void VisitExtVectorElementExpr(const ExtVectorElementExpr *Node)
Extra information about a function prototype.
Definition: Type.h:3779
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:2012
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:2843
bool isConst() const
Definition: Type.h:3642
const char * getName() const
Definition: Stmt.cpp:340
bool isInvalidDecl() const
Definition: DeclBase.h:545
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:2995
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:3196
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:3157
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1650
Represents a struct/union/class.
Definition: Decl.h:3592
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:2867
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:61
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:3564
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:131
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:575
is ARM Neon vector
Definition: Type.h:3196
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:2701
void VisitPackTemplateArgument(const TemplateArgument &TA)
Represents a member of a struct/union/class.
Definition: Decl.h:2578
void VisitEnumConstantDecl(const EnumConstantDecl *D)
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:4916
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
Definition: DeclCXX.h:2393
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:409
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5328
Represents an access specifier followed by colon &#39;:&#39;.
Definition: DeclCXX.h:131
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:109
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:3374
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:4219
Represents a C++ using-declaration.
Definition: DeclCXX.h:3359
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:4144
AssociationTy< true > ConstAssociation
Definition: Expr.h:5204
void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D)
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1370
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:2289
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:1397
bool isGlobalNew() const
Definition: ExprCXX.h:2149
A verbatim line command.
Definition: Comment.h:943
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node)
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:2846
An x-value expression is a reference to an object with independent storage but which can be "moved"...
Definition: Specifiers.h:118
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:4901
path_iterator path_begin()
Definition: Expr.h:3113
PropertyAttributeKind getPropertyAttributes() const
Definition: DeclObjC.h:839
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node)
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:653
bool isByRef() const
Whether this is a "by ref" capture, i.e.
Definition: Decl.h:3888
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:1840
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3318
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition: Expr.h:1981
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:1825
CXXRecordDecl * getDecl() const
Definition: Type.cpp:3334
bool isArrow() const
Definition: Expr.h:2917
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1381
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:1418
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool isAnyMemberInitializer() const
Definition: DeclCXX.h:2340
void dumpLocation(SourceLocation Loc)
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3041
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:1270
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
Definition: DeclBase.h:824
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1289
FieldDecl * getAnyMember() const
Definition: DeclCXX.h:2405
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:932
void * getAsOpaquePtr() const
Definition: Type.h:684
void VisitLabelStmt(const LabelStmt *Node)
An ordinary object is located at an address in memory.
Definition: Specifiers.h:125
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:3401
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4050
Represents an ObjC class declaration.
Definition: DeclObjC.h:1171
Represents a linkage specification.
Definition: DeclCXX.h:2833
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:3199
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:3765
SplitQualType getSplitDesugaredType() const
Definition: Type.h:943
A binding in a decomposition declaration.
Definition: DeclCXX.h:3802
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:3140
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
param_iterator param_begin()
Definition: Decl.h:2273
Represents the this expression in C++.
Definition: ExprCXX.h:1013
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4199
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:576
StringRef getArg() const
Definition: Decl.h:164
bool isArrayForm() const
Definition: ExprCXX.h:2276
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:3244
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:4372
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:1421
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3037
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
Definition: ASTContext.h:989
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3699
void VisitImplicitCastExpr(const ImplicitCastExpr *Node)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1391
QualType getComputationLHSType() const
Definition: Expr.h:3561
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:2360
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2260
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Node)
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
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:1004
This represents &#39;#pragma omp requires...&#39; directive.
Definition: DeclOpenMP.h:345
unsigned getValue() const
Definition: Expr.h:1459
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
Definition: Specifiers.h:135
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3038
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:2341
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3247
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3857
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:3238
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:2033
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:3522
Declaration of a template type parameter.
unsigned getIndex() const
Definition: Type.h:4578
void VisitObjCSelectorExpr(const ObjCSelectorExpr *Node)
unsigned getLine() const
Return the presumed line number of this location.
void VisitOMPExecutableDirective(const OMPExecutableDirective *D)
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:550
TextNodeDumper(raw_ostream &OS, bool ShowColors, const SourceManager *SM, const PrintingPolicy &PrintPolicy, const comments::CommandTraits *Traits)
const char * getTypeClassName() const
Definition: Type.cpp:2724
QualType getArgumentType() const
Definition: Expr.h:2297
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:430
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:337
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
TLSKind getTLSKind() const
Definition: Decl.cpp:1949
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:3981
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2330
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:3314
IdentifierInfo & getAccessor() const
Definition: Expr.h:5350
void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D)
decls_iterator decls_begin() const
Definition: ExprCXX.h:2826
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3330
bool isOMPStructuredBlock() const
Definition: Stmt.h:1052
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:578
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:1866
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
QualType getType() const
Definition: Expr.h:130
static const TerminalColor ValueKindColor
StorageClass
Storage classes.
Definition: Specifiers.h:205
A unary type transform, which is a type constructed from another.
Definition: Type.h:4301
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:583
bool isDirectionExplicit() const LLVM_READONLY
Definition: Comment.h:749
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1761
LabelDecl * getLabel() const
Definition: Stmt.h:2408
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:1934
bool isInstanceMethod() const
Definition: DeclObjC.h:421
void dumpBareType(QualType T, bool Desugar=true)
Represents a GCC generic vector type.
Definition: Type.h:3180
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:2861
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
UTTKind getUTTKind() const
Definition: Type.h:4329
StringRef getName() const
Definition: Decl.h:196
ValueDecl * getDecl()
Definition: Expr.h:1147
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:2025
void VisitExprWithCleanups(const ExprWithCleanups *Node)
bool isNull() const
Return true if this QualType doesn&#39;t point to a type yet.
Definition: Type.h:704
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1278
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:573
const SourceManager & SM
Definition: Format.cpp:1568
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)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3713
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *D)
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6092
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:3190
static StringRef getIdentKindName(IdentKind IK)
Definition: Expr.cpp:512
not a target-specific vector type
Definition: Type.h:3184
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:3755
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:3911
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:5763
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
bool isPure() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2008
void VisitDependentSizedArrayType(const DependentSizedArrayType *T)
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition: Stmt.h:2187
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:3623
void dumpPointer(const void *Ptr)
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:312
Represents a C++ temporary.
Definition: ExprCXX.h:1238
void VisitFixedPointLiteral(const FixedPointLiteral *Node)
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:5750
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2104
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:1989
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:375
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:3578
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:3644
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2048
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:821
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:1977
No ref-qualifier was provided.
Definition: Type.h:1367
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:4579
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:2291
bool isArray() const
Definition: ExprCXX.h:2113
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3519
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:3193
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:3320
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:3158
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:698
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:3187
PassDirection getDirection() const LLVM_READONLY
Definition: Comment.h:745
void VisitCXXNewExpr(const CXXNewExpr *Node)
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:2865
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:396
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2626
VarDecl * getVariable() const
The variable being captured.
Definition: Decl.h:3884
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:300
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:1373
SourceRange getBracketsRange() const
Definition: Type.h:3066
void VisitPackExpansionType(const PackExpansionType *T)
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
bool isArgumentType() const
Definition: Expr.h:2296
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:5392
bool isPartOfExplicitCast() const
Definition: Expr.h:3177
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:2094
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:4155
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:799
protocol_range protocols() const
Definition: DeclObjC.h:2355
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:4990
Represents a pack expansion of types.
Definition: Type.h:5367
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3538
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:1901
void VisitArrayType(const ArrayType *T)
Represents a C11 generic selection.
Definition: Expr.h:5044
SourceRange getRange() const
Definition: Attr.h:94
void VisitIntegerLiteral(const IntegerLiteral *Node)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3791
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:578
bool isDeduced() const
Definition: Type.h:4750
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2439
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2581
Dataflow Directional Tag Classes.
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5224
ExtInfo getExtInfo() const
Definition: Type.h:3636
not evaluated yet, for special member function
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1791
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1266
static const TerminalColor AttrColor
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2249
bool isNested() const
Whether this is a nested capture, i.e.
Definition: Decl.h:3900
bool isVariadic() const
Definition: Decl.h:3932
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2822
bool isImplicit() const
Definition: ExprCXX.h:1034
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition: Stmt.h:1819
Represents a field injected from an anonymous union/struct into the parent scope. ...
Definition: Decl.h:2824
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
QualType getUnderlyingType() const
Definition: Decl.h:2970
AccessSpecifier getAccess() const
Definition: DeclBase.h:465
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2612
unsigned getIndex() const
Retrieve the index of the template parameter.
bool usesADL() const
Definition: Expr.h:2562
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3547
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3674
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:3225
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
Definition: Type.h:972
Kind getKind() const
Definition: DeclBase.h:424
void VisitUnresolvedUsingType(const UnresolvedUsingType *T)
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1410
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
Definition: DeclCXX.cpp:2281
void VisitDeclRefExpr(const DeclRefExpr *Node)
Represents an enum.
Definition: Decl.h:3325
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
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:1325
LabelDecl * getLabel() const
Definition: Expr.h:3813
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:3114
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:1957
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class...
Definition: DeclCXX.h:1097
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:3769
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:4382
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:2263
unsigned getNumObjects() const
Definition: ExprCXX.h:3227
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:1823
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:2902
static const TerminalColor TypeColor
Opcode getOpcode() const
Definition: Expr.h:1959
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:2685
static const TerminalColor DeclKindNameColor
SourceRange getBracketsRange() const
Definition: Type.h:3009
static const char * getCastKindName(CastKind CK)
Definition: Expr.cpp:1748
bool isVolatile() const
Definition: Type.h:3643
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:3508
Represents a base class of a C++ class.
Definition: DeclCXX.h:191
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:128
void VisitCharacterLiteral(const CharacterLiteral *Node)
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
bool capturesCXXThis() const
Definition: Decl.h:3989
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3280
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2395
void VisitBinaryOperator(const BinaryOperator *Node)
TypedefNameDecl * getDecl() const
Definition: Type.h:4179
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
unsigned getDepth() const
Definition: Type.h:4577
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:2725
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:2653
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:299
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:1324
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:1585
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1944
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2140
void dumpBareDeclRef(const Decl *D)
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:3229
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:2275
void VisitObjCInterfaceType(const ObjCInterfaceType *T)
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1599
void dumpType(QualType T)
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2434
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:3479
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:3402
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:3339
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:269
unsigned getNumElements() const
Definition: Type.h:3216
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:2088
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:1074
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:4853
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:2135
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:677
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4331
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:3315
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:2900
QualType getType() const
Definition: Decl.h:647
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:113
void VisitNamespaceDecl(const NamespaceDecl *D)
void VisitAutoType(const AutoType *T)
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:599
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to...
Definition: Expr.cpp:1192
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:921
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:2720
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:561
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:2983
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
Represents a C++ namespace alias.
Definition: DeclCXX.h:3027
void VisitCXXThisExpr(const CXXThisExpr *Node)
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1363
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:2923
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:895
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:3072
bool hasInit() const
Definition: Decl.cpp:2177
SourceLocation getBegin() const
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4052
decls_iterator decls_end() const
Definition: ExprCXX.h:2829
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:1487
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2884
This class handles loading and caching of source files into memory.
The parameter is invariant: must match exactly.
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:3785
void VisitUnaryOperator(const UnaryOperator *Node)
void VisitLabelDecl(const LabelDecl *D)
Declaration of a template function.
Definition: DeclTemplate.h:968
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:2139
SourceLocation getLocation() const
Definition: DeclBase.h:421
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D)
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Definition: DeclCXX.h:3146
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:3123
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:162
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2728
bool param_empty() const
Definition: Decl.h:2272
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:290
void VisitRValueReferenceType(const ReferenceType *T)