clang  10.0.0svn
TextNodeDumper.cpp
Go to the documentation of this file.
1 //===--- TextNodeDumper.cpp - Printing of AST nodes -----------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements AST dumping of components of individual AST nodes.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "clang/AST/DeclFriend.h"
15 #include "clang/AST/DeclOpenMP.h"
16 #include "clang/AST/DeclTemplate.h"
17 #include "clang/AST/LocInfoType.h"
18 
19 using namespace clang;
20 
21 static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
22 
23 template <typename T>
24 static void dumpPreviousDeclImpl(raw_ostream &OS, const Mergeable<T> *D) {
25  const T *First = D->getFirstDecl();
26  if (First != D)
27  OS << " first " << First;
28 }
29 
30 template <typename T>
31 static void dumpPreviousDeclImpl(raw_ostream &OS, const Redeclarable<T> *D) {
32  const T *Prev = D->getPreviousDecl();
33  if (Prev)
34  OS << " prev " << Prev;
35 }
36 
37 /// Dump the previous declaration in the redeclaration chain for a declaration,
38 /// if any.
39 static void dumpPreviousDecl(raw_ostream &OS, const Decl *D) {
40  switch (D->getKind()) {
41 #define DECL(DERIVED, BASE) \
42  case Decl::DERIVED: \
43  return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
44 #define ABSTRACT_DECL(DECL)
45 #include "clang/AST/DeclNodes.inc"
46  }
47  llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
48 }
49 
50 TextNodeDumper::TextNodeDumper(raw_ostream &OS, bool ShowColors,
51  const SourceManager *SM,
52  const PrintingPolicy &PrintPolicy,
53  const comments::CommandTraits *Traits)
54  : TextTreeStructure(OS, ShowColors), OS(OS), ShowColors(ShowColors), SM(SM),
55  PrintPolicy(PrintPolicy), Traits(Traits) {}
56 
58  const comments::FullComment *FC) {
59  if (!C) {
60  ColorScope Color(OS, ShowColors, NullColor);
61  OS << "<<<NULL>>>";
62  return;
63  }
64 
65  {
66  ColorScope Color(OS, ShowColors, CommentColor);
67  OS << C->getCommentKindName();
68  }
69  dumpPointer(C);
71 
72  ConstCommentVisitor<TextNodeDumper, void,
73  const comments::FullComment *>::visit(C, FC);
74 }
75 
76 void TextNodeDumper::Visit(const Attr *A) {
77  {
78  ColorScope Color(OS, ShowColors, AttrColor);
79 
80  switch (A->getKind()) {
81 #define ATTR(X) \
82  case attr::X: \
83  OS << #X; \
84  break;
85 #include "clang/Basic/AttrList.inc"
86  }
87  OS << "Attr";
88  }
89  dumpPointer(A);
91  if (A->isInherited())
92  OS << " Inherited";
93  if (A->isImplicit())
94  OS << " Implicit";
95 
97 }
98 
100  const Decl *From, StringRef Label) {
101  OS << "TemplateArgument";
102  if (R.isValid())
103  dumpSourceRange(R);
104 
105  if (From)
106  dumpDeclRef(From, Label);
107 
109 }
110 
112  if (!Node) {
113  ColorScope Color(OS, ShowColors, NullColor);
114  OS << "<<<NULL>>>";
115  return;
116  }
117  {
118  ColorScope Color(OS, ShowColors, StmtColor);
119  OS << Node->getStmtClassName();
120  }
121  dumpPointer(Node);
123 
124  if (Node->isOMPStructuredBlock())
125  OS << " openmp_structured_block";
126 
127  if (const auto *E = dyn_cast<Expr>(Node)) {
128  dumpType(E->getType());
129 
130  {
131  ColorScope Color(OS, ShowColors, ValueKindColor);
132  switch (E->getValueKind()) {
133  case VK_RValue:
134  break;
135  case VK_LValue:
136  OS << " lvalue";
137  break;
138  case VK_XValue:
139  OS << " xvalue";
140  break;
141  }
142  }
143 
144  {
145  ColorScope Color(OS, ShowColors, ObjectKindColor);
146  switch (E->getObjectKind()) {
147  case OK_Ordinary:
148  break;
149  case OK_BitField:
150  OS << " bitfield";
151  break;
152  case OK_ObjCProperty:
153  OS << " objcproperty";
154  break;
155  case OK_ObjCSubscript:
156  OS << " objcsubscript";
157  break;
158  case OK_VectorComponent:
159  OS << " vectorcomponent";
160  break;
161  }
162  }
163  }
164 
166 }
167 
168 void TextNodeDumper::Visit(const Type *T) {
169  if (!T) {
170  ColorScope Color(OS, ShowColors, NullColor);
171  OS << "<<<NULL>>>";
172  return;
173  }
174  if (isa<LocInfoType>(T)) {
175  {
176  ColorScope Color(OS, ShowColors, TypeColor);
177  OS << "LocInfo Type";
178  }
179  dumpPointer(T);
180  return;
181  }
182 
183  {
184  ColorScope Color(OS, ShowColors, TypeColor);
185  OS << T->getTypeClassName() << "Type";
186  }
187  dumpPointer(T);
188  OS << " ";
189  dumpBareType(QualType(T, 0), false);
190 
191  QualType SingleStepDesugar =
193  if (SingleStepDesugar != QualType(T, 0))
194  OS << " sugar";
195 
196  if (T->isDependentType())
197  OS << " dependent";
198  else if (T->isInstantiationDependentType())
199  OS << " instantiation_dependent";
200 
201  if (T->isVariablyModifiedType())
202  OS << " variably_modified";
204  OS << " contains_unexpanded_pack";
205  if (T->isFromAST())
206  OS << " imported";
207 
209 }
210 
212  OS << "QualType";
214  OS << " ";
215  dumpBareType(T, false);
216  OS << " " << T.split().Quals.getAsString();
217 }
218 
219 void TextNodeDumper::Visit(const Decl *D) {
220  if (!D) {
221  ColorScope Color(OS, ShowColors, NullColor);
222  OS << "<<<NULL>>>";
223  return;
224  }
225 
226  {
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->isConstexprSpecified())
260  OS << " constexpr";
261  if (FD->isConsteval())
262  OS << " consteval";
263  }
264 
265  if (!isa<FunctionDecl>(*D)) {
266  const auto *MD = dyn_cast<ObjCMethodDecl>(D);
267  if (!MD || !MD->isThisDeclarationADefinition()) {
268  const auto *DC = dyn_cast<DeclContext>(D);
269  if (DC && DC->hasExternalLexicalStorage()) {
270  ColorScope Color(OS, ShowColors, UndeserializedColor);
271  OS << " <undeserialized declarations>";
272  }
273  }
274  }
275 
277 }
278 
280  OS << "CXXCtorInitializer";
281  if (Init->isAnyMemberInitializer()) {
282  OS << ' ';
283  dumpBareDeclRef(Init->getAnyMember());
284  } else if (Init->isBaseInitializer()) {
285  dumpType(QualType(Init->getBaseClass(), 0));
286  } else if (Init->isDelegatingInitializer()) {
287  dumpType(Init->getTypeSourceInfo()->getType());
288  } else {
289  llvm_unreachable("Unknown initializer type");
290  }
291 }
292 
294  OS << "capture";
295  if (C.isByRef())
296  OS << " byref";
297  if (C.isNested())
298  OS << " nested";
299  if (C.getVariable()) {
300  OS << ' ';
302  }
303 }
304 
306  if (!C) {
307  ColorScope Color(OS, ShowColors, NullColor);
308  OS << "<<<NULL>>> OMPClause";
309  return;
310  }
311  {
312  ColorScope Color(OS, ShowColors, AttrColor);
313  StringRef ClauseName(getOpenMPClauseName(C->getClauseKind()));
314  OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
315  << ClauseName.drop_front() << "Clause";
316  }
317  dumpPointer(C);
319  if (C->isImplicit())
320  OS << " <implicit>";
321 }
322 
324  const TypeSourceInfo *TSI = A.getTypeSourceInfo();
325  if (TSI) {
326  OS << "case ";
327  dumpType(TSI->getType());
328  } else {
329  OS << "default";
330  }
331 
332  if (A.isSelected())
333  OS << " selected";
334 }
335 
336 void TextNodeDumper::dumpPointer(const void *Ptr) {
337  ColorScope Color(OS, ShowColors, AddressColor);
338  OS << ' ' << Ptr;
339 }
340 
342  if (!SM)
343  return;
344 
345  ColorScope Color(OS, ShowColors, LocationColor);
346  SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
347 
348  // The general format we print out is filename:line:col, but we drop pieces
349  // that haven't changed since the last loc printed.
350  PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
351 
352  if (PLoc.isInvalid()) {
353  OS << "<invalid sloc>";
354  return;
355  }
356 
357  if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
358  OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
359  << PLoc.getColumn();
360  LastLocFilename = PLoc.getFilename();
361  LastLocLine = PLoc.getLine();
362  } else if (PLoc.getLine() != LastLocLine) {
363  OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
364  LastLocLine = PLoc.getLine();
365  } else {
366  OS << "col" << ':' << PLoc.getColumn();
367  }
368 }
369 
371  // Can't translate locations if a SourceManager isn't available.
372  if (!SM)
373  return;
374 
375  OS << " <";
376  dumpLocation(R.getBegin());
377  if (R.getBegin() != R.getEnd()) {
378  OS << ", ";
379  dumpLocation(R.getEnd());
380  }
381  OS << ">";
382 
383  // <t2.c:123:421[blah], t2.c:412:321>
384 }
385 
387  ColorScope Color(OS, ShowColors, TypeColor);
388 
389  SplitQualType T_split = T.split();
390  OS << "'" << QualType::getAsString(T_split, PrintPolicy) << "'";
391 
392  if (Desugar && !T.isNull()) {
393  // If the type is sugared, also dump a (shallow) desugared type.
394  SplitQualType D_split = T.getSplitDesugaredType();
395  if (T_split != D_split)
396  OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
397  }
398 }
399 
401  OS << ' ';
402  dumpBareType(T);
403 }
404 
406  if (!D) {
407  ColorScope Color(OS, ShowColors, NullColor);
408  OS << "<<<NULL>>>";
409  return;
410  }
411 
412  {
413  ColorScope Color(OS, ShowColors, DeclKindNameColor);
414  OS << D->getDeclKindName();
415  }
416  dumpPointer(D);
417 
418  if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
419  ColorScope Color(OS, ShowColors, DeclNameColor);
420  OS << " '" << ND->getDeclName() << '\'';
421  }
422 
423  if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
424  dumpType(VD->getType());
425 }
426 
428  if (ND->getDeclName()) {
429  ColorScope Color(OS, ShowColors, DeclNameColor);
430  OS << ' ' << ND->getNameAsString();
431  }
432 }
433 
435  switch (AS) {
436  case AS_none:
437  break;
438  case AS_public:
439  OS << "public";
440  break;
441  case AS_protected:
442  OS << "protected";
443  break;
444  case AS_private:
445  OS << "private";
446  break;
447  }
448 }
449 
450 void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
451  if (!D)
452  return;
453 
454  AddChild([=] {
455  if (!Label.empty())
456  OS << Label << ' ';
457  dumpBareDeclRef(D);
458  });
459 }
460 
461 const char *TextNodeDumper::getCommandName(unsigned CommandID) {
462  if (Traits)
463  return Traits->getCommandInfo(CommandID)->Name;
464  const comments::CommandInfo *Info =
466  if (Info)
467  return Info->Name;
468  return "<not a builtin command>";
469 }
470 
472  const comments::FullComment *) {
473  OS << " Text=\"" << C->getText() << "\"";
474 }
475 
478  OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
479  switch (C->getRenderKind()) {
481  OS << " RenderNormal";
482  break;
484  OS << " RenderBold";
485  break;
487  OS << " RenderMonospaced";
488  break;
490  OS << " RenderEmphasized";
491  break;
492  }
493 
494  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
495  OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
496 }
497 
500  OS << " Name=\"" << C->getTagName() << "\"";
501  if (C->getNumAttrs() != 0) {
502  OS << " Attrs: ";
503  for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
505  OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
506  }
507  }
508  if (C->isSelfClosing())
509  OS << " SelfClosing";
510 }
511 
514  OS << " Name=\"" << C->getTagName() << "\"";
515 }
516 
519  OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
520  for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
521  OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
522 }
523 
526  OS << " "
528 
529  if (C->isDirectionExplicit())
530  OS << " explicitly";
531  else
532  OS << " implicitly";
533 
534  if (C->hasParamName()) {
535  if (C->isParamIndexValid())
536  OS << " Param=\"" << C->getParamName(FC) << "\"";
537  else
538  OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
539  }
540 
541  if (C->isParamIndexValid() && !C->isVarArgParam())
542  OS << " ParamIndex=" << C->getParamIndex();
543 }
544 
547  if (C->hasParamName()) {
548  if (C->isPositionValid())
549  OS << " Param=\"" << C->getParamName(FC) << "\"";
550  else
551  OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
552  }
553 
554  if (C->isPositionValid()) {
555  OS << " Position=<";
556  for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
557  OS << C->getIndex(i);
558  if (i != e - 1)
559  OS << ", ";
560  }
561  OS << ">";
562  }
563 }
564 
567  OS << " Name=\"" << getCommandName(C->getCommandID())
568  << "\""
569  " CloseName=\""
570  << C->getCloseName() << "\"";
571 }
572 
575  const comments::FullComment *) {
576  OS << " Text=\"" << C->getText() << "\"";
577 }
578 
581  OS << " Text=\"" << C->getText() << "\"";
582 }
583 
585  OS << " null";
586 }
587 
589  OS << " type";
590  dumpType(TA.getAsType());
591 }
592 
594  const TemplateArgument &TA) {
595  OS << " decl";
596  dumpDeclRef(TA.getAsDecl());
597 }
598 
600  OS << " nullptr";
601 }
602 
604  OS << " integral " << TA.getAsIntegral();
605 }
606 
608  OS << " template ";
609  TA.getAsTemplate().dump(OS);
610 }
611 
613  const TemplateArgument &TA) {
614  OS << " template expansion ";
616 }
617 
619  OS << " expr";
620 }
621 
623  OS << " pack";
624 }
625 
626 static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
627  if (Node->path_empty())
628  return;
629 
630  OS << " (";
631  bool First = true;
632  for (CastExpr::path_const_iterator I = Node->path_begin(),
633  E = Node->path_end();
634  I != E; ++I) {
635  const CXXBaseSpecifier *Base = *I;
636  if (!First)
637  OS << " -> ";
638 
639  const auto *RD =
640  cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
641 
642  if (Base->isVirtual())
643  OS << "virtual ";
644  OS << RD->getName();
645  First = false;
646  }
647 
648  OS << ')';
649 }
650 
652  if (Node->hasInitStorage())
653  OS << " has_init";
654  if (Node->hasVarStorage())
655  OS << " has_var";
656  if (Node->hasElseStorage())
657  OS << " has_else";
658 }
659 
661  if (Node->hasInitStorage())
662  OS << " has_init";
663  if (Node->hasVarStorage())
664  OS << " has_var";
665 }
666 
668  if (Node->hasVarStorage())
669  OS << " has_var";
670 }
671 
673  OS << " '" << Node->getName() << "'";
674 }
675 
677  OS << " '" << Node->getLabel()->getName() << "'";
678  dumpPointer(Node->getLabel());
679 }
680 
682  if (Node->caseStmtIsGNURange())
683  OS << " gnu_range";
684 }
685 
687  if (Node->getResultAPValueKind() != APValue::None) {
688  ColorScope Color(OS, ShowColors, ValueColor);
689  OS << " ";
690  Node->getAPValueResult().dump(OS);
691  }
692 }
693 
695  if (Node->usesADL())
696  OS << " adl";
697 }
698 
700  OS << " <";
701  {
702  ColorScope Color(OS, ShowColors, CastColor);
703  OS << Node->getCastKindName();
704  }
705  dumpBasePath(OS, Node);
706  OS << ">";
707 }
708 
710  VisitCastExpr(Node);
711  if (Node->isPartOfExplicitCast())
712  OS << " part_of_explicit_cast";
713 }
714 
716  OS << " ";
717  dumpBareDeclRef(Node->getDecl());
718  if (Node->getDecl() != Node->getFoundDecl()) {
719  OS << " (";
720  dumpBareDeclRef(Node->getFoundDecl());
721  OS << ")";
722  }
723  switch (Node->isNonOdrUse()) {
724  case NOUR_None: break;
725  case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
726  case NOUR_Constant: OS << " non_odr_use_constant"; break;
727  case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
728  }
729 }
730 
732  const UnresolvedLookupExpr *Node) {
733  OS << " (";
734  if (!Node->requiresADL())
735  OS << "no ";
736  OS << "ADL) = '" << Node->getName() << '\'';
737 
739  E = Node->decls_end();
740  if (I == E)
741  OS << " empty";
742  for (; I != E; ++I)
743  dumpPointer(*I);
744 }
745 
747  {
748  ColorScope Color(OS, ShowColors, DeclKindNameColor);
749  OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
750  }
751  OS << "='" << *Node->getDecl() << "'";
752  dumpPointer(Node->getDecl());
753  if (Node->isFreeIvar())
754  OS << " isFreeIvar";
755 }
756 
758  OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
759 }
760 
762  ColorScope Color(OS, ShowColors, ValueColor);
763  OS << " " << Node->getValue();
764 }
765 
767  bool isSigned = Node->getType()->isSignedIntegerType();
768  ColorScope Color(OS, ShowColors, ValueColor);
769  OS << " " << Node->getValue().toString(10, isSigned);
770 }
771 
773  ColorScope Color(OS, ShowColors, ValueColor);
774  OS << " " << Node->getValueAsString(/*Radix=*/10);
775 }
776 
778  ColorScope Color(OS, ShowColors, ValueColor);
779  OS << " " << Node->getValueAsApproximateDouble();
780 }
781 
783  ColorScope Color(OS, ShowColors, ValueColor);
784  OS << " ";
785  Str->outputString(OS);
786 }
787 
789  if (auto *Field = ILE->getInitializedFieldInUnion()) {
790  OS << " field ";
791  dumpBareDeclRef(Field);
792  }
793 }
794 
796  if (E->isResultDependent())
797  OS << " result_dependent";
798 }
799 
801  OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
802  << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
803  if (!Node->canOverflow())
804  OS << " cannot overflow";
805 }
806 
809  switch (Node->getKind()) {
810  case UETT_SizeOf:
811  OS << " sizeof";
812  break;
813  case UETT_AlignOf:
814  OS << " alignof";
815  break;
816  case UETT_VecStep:
817  OS << " vec_step";
818  break;
820  OS << " __builtin_omp_required_simd_align";
821  break;
823  OS << " __alignof";
824  break;
825  }
826  if (Node->isArgumentType())
827  dumpType(Node->getArgumentType());
828 }
829 
831  OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
832  dumpPointer(Node->getMemberDecl());
833  switch (Node->isNonOdrUse()) {
834  case NOUR_None: break;
835  case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
836  case NOUR_Constant: OS << " non_odr_use_constant"; break;
837  case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
838  }
839 }
840 
842  const ExtVectorElementExpr *Node) {
843  OS << " " << Node->getAccessor().getNameStart();
844 }
845 
847  OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
848 }
849 
851  const CompoundAssignOperator *Node) {
852  OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
853  << "' ComputeLHSTy=";
855  OS << " ComputeResultTy=";
857 }
858 
860  OS << " " << Node->getLabel()->getName();
861  dumpPointer(Node->getLabel());
862 }
863 
865  OS << " " << Node->getCastName() << "<"
866  << Node->getTypeAsWritten().getAsString() << ">"
867  << " <" << Node->getCastKindName();
868  dumpBasePath(OS, Node);
869  OS << ">";
870 }
871 
873  OS << " " << (Node->getValue() ? "true" : "false");
874 }
875 
877  if (Node->isImplicit())
878  OS << " implicit";
879  OS << " this";
880 }
881 
883  const CXXFunctionalCastExpr *Node) {
884  OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
885  << Node->getCastKindName() << ">";
886 }
887 
890  dumpType(Node->getTypeAsWritten());
891  if (Node->isListInitialization())
892  OS << " list";
893 }
894 
896  CXXConstructorDecl *Ctor = Node->getConstructor();
897  dumpType(Ctor->getType());
898  if (Node->isElidable())
899  OS << " elidable";
900  if (Node->isListInitialization())
901  OS << " list";
902  if (Node->isStdInitListInitialization())
903  OS << " std::initializer_list";
904  if (Node->requiresZeroInitialization())
905  OS << " zeroing";
906 }
907 
909  const CXXBindTemporaryExpr *Node) {
910  OS << " (CXXTemporary";
911  dumpPointer(Node);
912  OS << ")";
913 }
914 
916  if (Node->isGlobalNew())
917  OS << " global";
918  if (Node->isArray())
919  OS << " array";
920  if (Node->getOperatorNew()) {
921  OS << ' ';
923  }
924  // We could dump the deallocation function used in case of error, but it's
925  // usually not that interesting.
926 }
927 
929  if (Node->isGlobalDelete())
930  OS << " global";
931  if (Node->isArrayForm())
932  OS << " array";
933  if (Node->getOperatorDelete()) {
934  OS << ' ';
936  }
937 }
938 
941  if (const ValueDecl *VD = Node->getExtendingDecl()) {
942  OS << " extended by ";
943  dumpBareDeclRef(VD);
944  }
945 }
946 
948  for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
949  dumpDeclRef(Node->getObject(i), "cleanup");
950 }
951 
953  dumpPointer(Node->getPack());
954  dumpName(Node->getPack());
955 }
956 
959  OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
960 }
961 
963  OS << " selector=";
964  Node->getSelector().print(OS);
965  switch (Node->getReceiverKind()) {
967  break;
968 
970  OS << " class=";
972  break;
973 
975  OS << " super (instance)";
976  break;
977 
979  OS << " super (class)";
980  break;
981  }
982 }
983 
985  if (auto *BoxingMethod = Node->getBoxingMethod()) {
986  OS << " selector=";
987  BoxingMethod->getSelector().print(OS);
988  }
989 }
990 
992  if (!Node->getCatchParamDecl())
993  OS << " catch all";
994 }
995 
997  dumpType(Node->getEncodedType());
998 }
999 
1001  OS << " ";
1002  Node->getSelector().print(OS);
1003 }
1004 
1006  OS << ' ' << *Node->getProtocol();
1007 }
1008 
1010  if (Node->isImplicitProperty()) {
1011  OS << " Kind=MethodRef Getter=\"";
1012  if (Node->getImplicitPropertyGetter())
1014  else
1015  OS << "(null)";
1016 
1017  OS << "\" Setter=\"";
1018  if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1019  Setter->getSelector().print(OS);
1020  else
1021  OS << "(null)";
1022  OS << "\"";
1023  } else {
1024  OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1025  << '"';
1026  }
1027 
1028  if (Node->isSuperReceiver())
1029  OS << " super";
1030 
1031  OS << " Messaging=";
1032  if (Node->isMessagingGetter() && Node->isMessagingSetter())
1033  OS << "Getter&Setter";
1034  else if (Node->isMessagingGetter())
1035  OS << "Getter";
1036  else if (Node->isMessagingSetter())
1037  OS << "Setter";
1038 }
1039 
1041  const ObjCSubscriptRefExpr *Node) {
1042  if (Node->isArraySubscriptRefExpr())
1043  OS << " Kind=ArraySubscript GetterForArray=\"";
1044  else
1045  OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1046  if (Node->getAtIndexMethodDecl())
1047  Node->getAtIndexMethodDecl()->getSelector().print(OS);
1048  else
1049  OS << "(null)";
1050 
1051  if (Node->isArraySubscriptRefExpr())
1052  OS << "\" SetterForArray=\"";
1053  else
1054  OS << "\" SetterForDictionary=\"";
1055  if (Node->setAtIndexMethodDecl())
1056  Node->setAtIndexMethodDecl()->getSelector().print(OS);
1057  else
1058  OS << "(null)";
1059 }
1060 
1062  OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1063 }
1064 
1066  if (T->isSpelledAsLValue())
1067  OS << " written as lvalue reference";
1068 }
1069 
1071  switch (T->getSizeModifier()) {
1072  case ArrayType::Normal:
1073  break;
1074  case ArrayType::Static:
1075  OS << " static";
1076  break;
1077  case ArrayType::Star:
1078  OS << " *";
1079  break;
1080  }
1081  OS << " " << T->getIndexTypeQualifiers().getAsString();
1082 }
1083 
1085  OS << " " << T->getSize();
1086  VisitArrayType(T);
1087 }
1088 
1090  OS << " ";
1092  VisitArrayType(T);
1093 }
1094 
1096  const DependentSizedArrayType *T) {
1097  VisitArrayType(T);
1098  OS << " ";
1100 }
1101 
1103  const DependentSizedExtVectorType *T) {
1104  OS << " ";
1106 }
1107 
1109  switch (T->getVectorKind()) {
1111  break;
1113  OS << " altivec";
1114  break;
1116  OS << " altivec pixel";
1117  break;
1119  OS << " altivec bool";
1120  break;
1122  OS << " neon";
1123  break;
1125  OS << " neon poly";
1126  break;
1127  }
1128  OS << " " << T->getNumElements();
1129 }
1130 
1132  auto EI = T->getExtInfo();
1133  if (EI.getNoReturn())
1134  OS << " noreturn";
1135  if (EI.getProducesResult())
1136  OS << " produces_result";
1137  if (EI.getHasRegParm())
1138  OS << " regparm " << EI.getRegParm();
1139  OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1140 }
1141 
1143  auto EPI = T->getExtProtoInfo();
1144  if (EPI.HasTrailingReturn)
1145  OS << " trailing_return";
1146  if (T->isConst())
1147  OS << " const";
1148  if (T->isVolatile())
1149  OS << " volatile";
1150  if (T->isRestrict())
1151  OS << " restrict";
1152  if (T->getExtProtoInfo().Variadic)
1153  OS << " variadic";
1154  switch (EPI.RefQualifier) {
1155  case RQ_None:
1156  break;
1157  case RQ_LValue:
1158  OS << " &";
1159  break;
1160  case RQ_RValue:
1161  OS << " &&";
1162  break;
1163  }
1164  // FIXME: Exception specification.
1165  // FIXME: Consumed parameters.
1166  VisitFunctionType(T);
1167 }
1168 
1170  dumpDeclRef(T->getDecl());
1171 }
1172 
1174  dumpDeclRef(T->getDecl());
1175 }
1176 
1178  switch (T->getUTTKind()) {
1180  OS << " underlying_type";
1181  break;
1182  }
1183 }
1184 
1186  dumpDeclRef(T->getDecl());
1187 }
1188 
1190  OS << " depth " << T->getDepth() << " index " << T->getIndex();
1191  if (T->isParameterPack())
1192  OS << " pack";
1193  dumpDeclRef(T->getDecl());
1194 }
1195 
1197  if (T->isDecltypeAuto())
1198  OS << " decltype(auto)";
1199  if (!T->isDeduced())
1200  OS << " undeduced";
1201 }
1202 
1204  const TemplateSpecializationType *T) {
1205  if (T->isTypeAlias())
1206  OS << " alias";
1207  OS << " ";
1208  T->getTemplateName().dump(OS);
1209 }
1210 
1212  const InjectedClassNameType *T) {
1213  dumpDeclRef(T->getDecl());
1214 }
1215 
1217  dumpDeclRef(T->getDecl());
1218 }
1219 
1221  if (auto N = T->getNumExpansions())
1222  OS << " expansions " << *N;
1223 }
1224 
1226 
1228  dumpName(D);
1230  if (D->isModulePrivate())
1231  OS << " __module_private__";
1232 }
1233 
1235  if (D->isScoped()) {
1236  if (D->isScopedUsingClassTag())
1237  OS << " class";
1238  else
1239  OS << " struct";
1240  }
1241  dumpName(D);
1242  if (D->isModulePrivate())
1243  OS << " __module_private__";
1244  if (D->isFixed())
1245  dumpType(D->getIntegerType());
1246 }
1247 
1249  OS << ' ' << D->getKindName();
1250  dumpName(D);
1251  if (D->isModulePrivate())
1252  OS << " __module_private__";
1253  if (D->isCompleteDefinition())
1254  OS << " definition";
1255 }
1256 
1258  dumpName(D);
1259  dumpType(D->getType());
1260 }
1261 
1263  dumpName(D);
1264  dumpType(D->getType());
1265 
1266  for (const auto *Child : D->chain())
1267  dumpDeclRef(Child);
1268 }
1269 
1271  dumpName(D);
1272  dumpType(D->getType());
1273 
1274  StorageClass SC = D->getStorageClass();
1275  if (SC != SC_None)
1276  OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);
1277  if (D->isInlineSpecified())
1278  OS << " inline";
1279  if (D->isVirtualAsWritten())
1280  OS << " virtual";
1281  if (D->isModulePrivate())
1282  OS << " __module_private__";
1283 
1284  if (D->isPure())
1285  OS << " pure";
1286  if (D->isDefaulted()) {
1287  OS << " default";
1288  if (D->isDeleted())
1289  OS << "_delete";
1290  }
1291  if (D->isDeletedAsWritten())
1292  OS << " delete";
1293  if (D->isTrivial())
1294  OS << " trivial";
1295 
1296  if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
1297  FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
1298  switch (EPI.ExceptionSpec.Type) {
1299  default:
1300  break;
1301  case EST_Unevaluated:
1302  OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
1303  break;
1304  case EST_Uninstantiated:
1305  OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
1306  break;
1307  }
1308  }
1309 
1310  if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
1311  if (MD->size_overridden_methods() != 0) {
1312  auto dumpOverride = [=](const CXXMethodDecl *D) {
1313  SplitQualType T_split = D->getType().split();
1314  OS << D << " " << D->getParent()->getName()
1315  << "::" << D->getNameAsString() << " '"
1316  << QualType::getAsString(T_split, PrintPolicy) << "'";
1317  };
1318 
1319  AddChild([=] {
1320  auto Overrides = MD->overridden_methods();
1321  OS << "Overrides: [ ";
1322  dumpOverride(*Overrides.begin());
1323  for (const auto *Override :
1324  llvm::make_range(Overrides.begin() + 1, Overrides.end())) {
1325  OS << ", ";
1326  dumpOverride(Override);
1327  }
1328  OS << " ]";
1329  });
1330  }
1331  }
1332 
1333  // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
1334  // the Params are set later, it is possible for a dump during debugging to
1335  // encounter a FunctionDecl that has been created but hasn't been assigned
1336  // ParmVarDecls yet.
1337  if (!D->param_empty() && !D->param_begin())
1338  OS << " <<<NULL params x " << D->getNumParams() << ">>>";
1339 }
1340 
1342  dumpName(D);
1343  dumpType(D->getType());
1344  if (D->isMutable())
1345  OS << " mutable";
1346  if (D->isModulePrivate())
1347  OS << " __module_private__";
1348 }
1349 
1351  dumpName(D);
1352  dumpType(D->getType());
1353  StorageClass SC = D->getStorageClass();
1354  if (SC != SC_None)
1355  OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);
1356  switch (D->getTLSKind()) {
1357  case VarDecl::TLS_None:
1358  break;
1359  case VarDecl::TLS_Static:
1360  OS << " tls";
1361  break;
1362  case VarDecl::TLS_Dynamic:
1363  OS << " tls_dynamic";
1364  break;
1365  }
1366  if (D->isModulePrivate())
1367  OS << " __module_private__";
1368  if (D->isNRVOVariable())
1369  OS << " nrvo";
1370  if (D->isInline())
1371  OS << " inline";
1372  if (D->isConstexpr())
1373  OS << " constexpr";
1374  if (D->hasInit()) {
1375  switch (D->getInitStyle()) {
1376  case VarDecl::CInit:
1377  OS << " cinit";
1378  break;
1379  case VarDecl::CallInit:
1380  OS << " callinit";
1381  break;
1382  case VarDecl::ListInit:
1383  OS << " listinit";
1384  break;
1385  }
1386  }
1387  if (D->needsDestruction(D->getASTContext()))
1388  OS << " destroyed";
1389  if (D->isParameterPack())
1390  OS << " pack";
1391 }
1392 
1394  dumpName(D);
1395  dumpType(D->getType());
1396 }
1397 
1399  if (D->isNothrow())
1400  OS << " nothrow";
1401 }
1402 
1404  OS << ' ' << D->getImportedModule()->getFullModuleName();
1405 
1406  for (Decl *InitD :
1408  dumpDeclRef(InitD, "initializer");
1409 }
1410 
1412  OS << ' ';
1413  switch (D->getCommentKind()) {
1414  case PCK_Unknown:
1415  llvm_unreachable("unexpected pragma comment kind");
1416  case PCK_Compiler:
1417  OS << "compiler";
1418  break;
1419  case PCK_ExeStr:
1420  OS << "exestr";
1421  break;
1422  case PCK_Lib:
1423  OS << "lib";
1424  break;
1425  case PCK_Linker:
1426  OS << "linker";
1427  break;
1428  case PCK_User:
1429  OS << "user";
1430  break;
1431  }
1432  StringRef Arg = D->getArg();
1433  if (!Arg.empty())
1434  OS << " \"" << Arg << "\"";
1435 }
1436 
1438  const PragmaDetectMismatchDecl *D) {
1439  OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
1440 }
1441 
1443  const OMPExecutableDirective *D) {
1444  if (D->isStandaloneDirective())
1445  OS << " openmp_standalone_directive";
1446 }
1447 
1449  const OMPDeclareReductionDecl *D) {
1450  dumpName(D);
1451  dumpType(D->getType());
1452  OS << " combiner";
1453  dumpPointer(D->getCombiner());
1454  if (const auto *Initializer = D->getInitializer()) {
1455  OS << " initializer";
1457  switch (D->getInitializerKind()) {
1459  OS << " omp_priv = ";
1460  break;
1462  OS << " omp_priv ()";
1463  break;
1465  break;
1466  }
1467  }
1468 }
1469 
1471  for (const auto *C : D->clauselists()) {
1472  AddChild([=] {
1473  if (!C) {
1474  ColorScope Color(OS, ShowColors, NullColor);
1475  OS << "<<<NULL>>> OMPClause";
1476  return;
1477  }
1478  {
1479  ColorScope Color(OS, ShowColors, AttrColor);
1480  StringRef ClauseName(getOpenMPClauseName(C->getClauseKind()));
1481  OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
1482  << ClauseName.drop_front() << "Clause";
1483  }
1484  dumpPointer(C);
1485  dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
1486  });
1487  }
1488 }
1489 
1491  dumpName(D);
1492  dumpType(D->getType());
1493 }
1494 
1496  dumpName(D);
1497  if (D->isInline())
1498  OS << " inline";
1499  if (!D->isOriginalNamespace())
1500  dumpDeclRef(D->getOriginalNamespace(), "original");
1501 }
1502 
1504  OS << ' ';
1506 }
1507 
1509  dumpName(D);
1511 }
1512 
1514  dumpName(D);
1516 }
1517 
1519  const TypeAliasTemplateDecl *D) {
1520  dumpName(D);
1521 }
1522 
1524  VisitRecordDecl(D);
1525  if (!D->isCompleteDefinition())
1526  return;
1527 
1528  AddChild([=] {
1529  {
1530  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1531  OS << "DefinitionData";
1532  }
1533 #define FLAG(fn, name) \
1534  if (D->fn()) \
1535  OS << " " #name;
1536  FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
1537 
1538  FLAG(isGenericLambda, generic);
1539  FLAG(isLambda, lambda);
1540 
1541  FLAG(isAnonymousStructOrUnion, is_anonymous);
1542  FLAG(canPassInRegisters, pass_in_registers);
1543  FLAG(isEmpty, empty);
1544  FLAG(isAggregate, aggregate);
1545  FLAG(isStandardLayout, standard_layout);
1546  FLAG(isTriviallyCopyable, trivially_copyable);
1547  FLAG(isPOD, pod);
1548  FLAG(isTrivial, trivial);
1549  FLAG(isPolymorphic, polymorphic);
1550  FLAG(isAbstract, abstract);
1551  FLAG(isLiteral, literal);
1552 
1553  FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
1554  FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
1555  FLAG(hasMutableFields, has_mutable_fields);
1556  FLAG(hasVariantMembers, has_variant_members);
1557  FLAG(allowConstDefaultInit, can_const_default_init);
1558 
1559  AddChild([=] {
1560  {
1561  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1562  OS << "DefaultConstructor";
1563  }
1564  FLAG(hasDefaultConstructor, exists);
1565  FLAG(hasTrivialDefaultConstructor, trivial);
1566  FLAG(hasNonTrivialDefaultConstructor, non_trivial);
1567  FLAG(hasUserProvidedDefaultConstructor, user_provided);
1568  FLAG(hasConstexprDefaultConstructor, constexpr);
1569  FLAG(needsImplicitDefaultConstructor, needs_implicit);
1570  FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
1571  });
1572 
1573  AddChild([=] {
1574  {
1575  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1576  OS << "CopyConstructor";
1577  }
1578  FLAG(hasSimpleCopyConstructor, simple);
1579  FLAG(hasTrivialCopyConstructor, trivial);
1580  FLAG(hasNonTrivialCopyConstructor, non_trivial);
1581  FLAG(hasUserDeclaredCopyConstructor, user_declared);
1582  FLAG(hasCopyConstructorWithConstParam, has_const_param);
1583  FLAG(needsImplicitCopyConstructor, needs_implicit);
1584  FLAG(needsOverloadResolutionForCopyConstructor,
1585  needs_overload_resolution);
1587  FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
1588  FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
1589  });
1590 
1591  AddChild([=] {
1592  {
1593  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1594  OS << "MoveConstructor";
1595  }
1596  FLAG(hasMoveConstructor, exists);
1597  FLAG(hasSimpleMoveConstructor, simple);
1598  FLAG(hasTrivialMoveConstructor, trivial);
1599  FLAG(hasNonTrivialMoveConstructor, non_trivial);
1600  FLAG(hasUserDeclaredMoveConstructor, user_declared);
1601  FLAG(needsImplicitMoveConstructor, needs_implicit);
1602  FLAG(needsOverloadResolutionForMoveConstructor,
1603  needs_overload_resolution);
1605  FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
1606  });
1607 
1608  AddChild([=] {
1609  {
1610  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1611  OS << "CopyAssignment";
1612  }
1613  FLAG(hasTrivialCopyAssignment, trivial);
1614  FLAG(hasNonTrivialCopyAssignment, non_trivial);
1615  FLAG(hasCopyAssignmentWithConstParam, has_const_param);
1616  FLAG(hasUserDeclaredCopyAssignment, user_declared);
1617  FLAG(needsImplicitCopyAssignment, needs_implicit);
1618  FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
1619  FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
1620  });
1621 
1622  AddChild([=] {
1623  {
1624  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1625  OS << "MoveAssignment";
1626  }
1627  FLAG(hasMoveAssignment, exists);
1628  FLAG(hasSimpleMoveAssignment, simple);
1629  FLAG(hasTrivialMoveAssignment, trivial);
1630  FLAG(hasNonTrivialMoveAssignment, non_trivial);
1631  FLAG(hasUserDeclaredMoveAssignment, user_declared);
1632  FLAG(needsImplicitMoveAssignment, needs_implicit);
1633  FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
1634  });
1635 
1636  AddChild([=] {
1637  {
1638  ColorScope Color(OS, ShowColors, DeclKindNameColor);
1639  OS << "Destructor";
1640  }
1641  FLAG(hasSimpleDestructor, simple);
1642  FLAG(hasIrrelevantDestructor, irrelevant);
1643  FLAG(hasTrivialDestructor, trivial);
1644  FLAG(hasNonTrivialDestructor, non_trivial);
1645  FLAG(hasUserDeclaredDestructor, user_declared);
1646  FLAG(hasConstexprDestructor, constexpr);
1647  FLAG(needsImplicitDestructor, needs_implicit);
1648  FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
1650  FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
1651  });
1652  });
1653 
1654  for (const auto &I : D->bases()) {
1655  AddChild([=] {
1656  if (I.isVirtual())
1657  OS << "virtual ";
1658  dumpAccessSpecifier(I.getAccessSpecifier());
1659  dumpType(I.getType());
1660  if (I.isPackExpansion())
1661  OS << "...";
1662  });
1663  }
1664 }
1665 
1667  dumpName(D);
1668 }
1669 
1671  dumpName(D);
1672 }
1673 
1675  dumpName(D);
1676 }
1677 
1679  dumpName(D);
1680 }
1681 
1683  if (D->wasDeclaredWithTypename())
1684  OS << " typename";
1685  else
1686  OS << " class";
1687  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1688  if (D->isParameterPack())
1689  OS << " ...";
1690  dumpName(D);
1691 }
1692 
1694  const NonTypeTemplateParmDecl *D) {
1695  dumpType(D->getType());
1696  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1697  if (D->isParameterPack())
1698  OS << " ...";
1699  dumpName(D);
1700 }
1701 
1703  const TemplateTemplateParmDecl *D) {
1704  OS << " depth " << D->getDepth() << " index " << D->getIndex();
1705  if (D->isParameterPack())
1706  OS << " ...";
1707  dumpName(D);
1708 }
1709 
1711  OS << ' ';
1712  if (D->getQualifier())
1714  OS << D->getNameAsString();
1715 }
1716 
1718  const UnresolvedUsingTypenameDecl *D) {
1719  OS << ' ';
1720  if (D->getQualifier())
1722  OS << D->getNameAsString();
1723 }
1724 
1726  const UnresolvedUsingValueDecl *D) {
1727  OS << ' ';
1728  if (D->getQualifier())
1730  OS << D->getNameAsString();
1731  dumpType(D->getType());
1732 }
1733 
1735  OS << ' ';
1737 }
1738 
1740  const ConstructorUsingShadowDecl *D) {
1741  if (D->constructsVirtualBase())
1742  OS << " virtual";
1743 
1744  AddChild([=] {
1745  OS << "target ";
1747  });
1748 
1749  AddChild([=] {
1750  OS << "nominated ";
1752  OS << ' ';
1754  });
1755 
1756  AddChild([=] {
1757  OS << "constructed ";
1759  OS << ' ';
1761  });
1762 }
1763 
1765  switch (D->getLanguage()) {
1767  OS << " C";
1768  break;
1770  OS << " C++";
1771  break;
1773  OS << " C++11";
1774  break;
1776  OS << " C++14";
1777  break;
1778  }
1779 }
1780 
1782  OS << ' ';
1784 }
1785 
1787  if (TypeSourceInfo *T = D->getFriendType())
1788  dumpType(T->getType());
1789 }
1790 
1792  dumpName(D);
1793  dumpType(D->getType());
1794  if (D->getSynthesize())
1795  OS << " synthesize";
1796 
1797  switch (D->getAccessControl()) {
1798  case ObjCIvarDecl::None:
1799  OS << " none";
1800  break;
1801  case ObjCIvarDecl::Private:
1802  OS << " private";
1803  break;
1805  OS << " protected";
1806  break;
1807  case ObjCIvarDecl::Public:
1808  OS << " public";
1809  break;
1810  case ObjCIvarDecl::Package:
1811  OS << " package";
1812  break;
1813  }
1814 }
1815 
1817  if (D->isInstanceMethod())
1818  OS << " -";
1819  else
1820  OS << " +";
1821  dumpName(D);
1822  dumpType(D->getReturnType());
1823 
1824  if (D->isVariadic())
1825  OS << " variadic";
1826 }
1827 
1829  dumpName(D);
1830  switch (D->getVariance()) {
1832  break;
1833 
1835  OS << " covariant";
1836  break;
1837 
1839  OS << " contravariant";
1840  break;
1841  }
1842 
1843  if (D->hasExplicitBound())
1844  OS << " bounded";
1846 }
1847 
1849  dumpName(D);
1852  for (const auto *P : D->protocols())
1853  dumpDeclRef(P);
1854 }
1855 
1857  dumpName(D);
1860 }
1861 
1863  dumpName(D);
1864 
1865  for (const auto *Child : D->protocols())
1866  dumpDeclRef(Child);
1867 }
1868 
1870  dumpName(D);
1871  dumpDeclRef(D->getSuperClass(), "super");
1872 
1874  for (const auto *Child : D->protocols())
1875  dumpDeclRef(Child);
1876 }
1877 
1879  const ObjCImplementationDecl *D) {
1880  dumpName(D);
1881  dumpDeclRef(D->getSuperClass(), "super");
1883 }
1884 
1886  const ObjCCompatibleAliasDecl *D) {
1887  dumpName(D);
1889 }
1890 
1892  dumpName(D);
1893  dumpType(D->getType());
1894 
1896  OS << " required";
1898  OS << " optional";
1899 
1901  if (Attrs != ObjCPropertyDecl::OBJC_PR_noattr) {
1903  OS << " readonly";
1905  OS << " assign";
1907  OS << " readwrite";
1909  OS << " retain";
1910  if (Attrs & ObjCPropertyDecl::OBJC_PR_copy)
1911  OS << " copy";
1913  OS << " nonatomic";
1915  OS << " atomic";
1916  if (Attrs & ObjCPropertyDecl::OBJC_PR_weak)
1917  OS << " weak";
1919  OS << " strong";
1921  OS << " unsafe_unretained";
1922  if (Attrs & ObjCPropertyDecl::OBJC_PR_class)
1923  OS << " class";
1925  dumpDeclRef(D->getGetterMethodDecl(), "getter");
1927  dumpDeclRef(D->getSetterMethodDecl(), "setter");
1928  }
1929 }
1930 
1932  dumpName(D->getPropertyDecl());
1934  OS << " synthesize";
1935  else
1936  OS << " dynamic";
1939 }
1940 
1942  if (D->isVariadic())
1943  OS << " variadic";
1944 
1945  if (D->capturesCXXThis())
1946  OS << " captures_this";
1947 }
1948 
1950  dumpName(D);
1951 }
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:2206
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:3195
void VisitVarTemplateDecl(const VarTemplateDecl *D)
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3130
Represents a function declaration or definition.
Definition: Decl.h:1784
static const TerminalColor StmtColor
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1259
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:3957
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:759
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Definition: Type.h:4160
void VisitIfStmt(const IfStmt *Node)
StringRef getArgText(unsigned Idx) const
Definition: Comment.h:672
A (possibly-)qualified type.
Definition: Type.h:643
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
base_class_range bases()
Definition: DeclCXX.h:589
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:2894
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:1892
static void dumpPreviousDeclImpl(raw_ostream &OS,...)
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3444
bool isPositionValid() const LLVM_READONLY
Definition: Comment.h:842
void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D)
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:519
Stmt - This represents one statement.
Definition: Stmt.h:66
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:25
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3393
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1822
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:900
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:2855
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1034
Represents the declaration of a typedef-name via the &#39;typedef&#39; type specifier.
Definition: Decl.h:3087
void VisitOMPRequiresDecl(const OMPRequiresDecl *D)
bool isDecltypeAuto() const
Definition: Type.h:4834
void VisitPredefinedExpr(const PredefinedExpr *Node)
void VisitCompoundAssignOperator(const CompoundAssignOperator *Node)
void VisitFriendDecl(const FriendDecl *D)
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:957
TagDecl * getDecl() const
Definition: Type.cpp:3293
void VisitObjCProtocolExpr(const ObjCProtocolExpr *Node)
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:717
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
bool isNothrow() const
Definition: Decl.cpp:4667
FunctionDecl * getOperatorNew() const
Definition: ExprCXX.h:2218
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Definition: DeclCXX.h:200
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3037
Defines the C++ template declaration subclasses.
Opcode getOpcode() const
Definition: Expr.h:3444
Represents a C++11 auto or C++14 decltype(auto) type.
Definition: Type.h:4823
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:1436
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
Definition: ExprCXX.h:1533
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:2860
void VisitImportDecl(const ImportDecl *D)
Represent a C++ namespace.
Definition: Decl.h:522
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1422
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:113
StringRef getParamName(const FullComment *FC) const
Definition: Comment.cpp:371
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:2085
IdentKind getIdentKind() const
Definition: Expr.h:1926
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node)
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:4643
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2365
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:4419
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2050
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class...
Definition: DeclCXX.h:774
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
static const TerminalColor ObjectKindColor
This name appears in an unevaluated operand.
Definition: Specifiers.h:164
void dumpSourceRange(SourceRange R)
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3238
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:3194
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:156
Represents a variable declaration or definition.
Definition: Decl.h:827
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:3598
const T * getAs() const
Member-template getAs<specific type>&#39;.
Definition: Type.h:6858
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2019
void VisitExtVectorElementExpr(const ExtVectorElementExpr *Node)
Extra information about a function prototype.
Definition: Type.h:3805
void dump() const
Definition: APValue.cpp:381
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:2082
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:2953
bool isConst() const
Definition: Type.h:3668
const char * getName() const
Definition: Stmt.cpp:351
bool isInvalidDecl() const
Definition: DeclBase.h:553
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3105
Not a TLS variable.
Definition: Decl.h:844
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:3306
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:75
SourceLocation getAttributeLoc() const
Definition: Type.h:3183
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1720
Represents a struct/union/class.
Definition: Decl.h:3662
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:2789
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:63
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:3655
QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const
Do we need to emit an exit-time destructor for this variable, and if so, what kind?
Definition: Decl.cpp:2598
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user...
Definition: Attr.h:98
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
A vector component is an element or range of elements on a vector.
Definition: Specifiers.h:147
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:583
is ARM Neon vector
Definition: Type.h:3222
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:2737
void VisitPackTemplateArgument(const TemplateArgument &TA)
Represents a member of a struct/union/class.
Definition: Decl.h:2643
void VisitEnumConstantDecl(const EnumConstantDecl *D)
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:4980
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
Definition: DeclCXX.h:2267
void VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D)
StringRef getText() const LLVM_READONLY
Definition: Comment.h:883
StringRef getValue() const
Definition: Decl.h:197
void VisitTypeAliasDecl(const TypeAliasDecl *D)
InitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:173
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:924
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:31
void VisitFunctionProtoType(const FunctionProtoType *T)
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:417
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5490
Represents an access specifier followed by colon &#39;:&#39;.
Definition: DeclCXX.h:87
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:125
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:3465
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:4375
Represents a C++ using-declaration.
Definition: DeclCXX.h:3275
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:4171
AssociationTy< true > ConstAssociation
Definition: Expr.h:5366
void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D)
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1392
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:2399
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:1500
bool isGlobalNew() const
Definition: ExprCXX.h:2259
A verbatim line command.
Definition: Comment.h:943
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node)
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:2916
An x-value expression is a reference to an object with independent storage but which can be "moved"...
Definition: Specifiers.h:134
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:4965
path_iterator path_begin()
Definition: Expr.h:3197
PropertyAttributeKind getPropertyAttributes() const
Definition: DeclObjC.h:839
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node)
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:670
bool isByRef() const
Whether this is a "by ref" capture, i.e.
Definition: Decl.h:3982
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:1871
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3409
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition: Expr.h:2068
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:1895
CXXRecordDecl * getDecl() const
Definition: Type.cpp:3383
bool isArrow() const
Definition: Expr.h:2995
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1417
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:1488
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool isAnyMemberInitializer() const
Definition: DeclCXX.h:2214
void dumpLocation(SourceLocation Loc)
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3125
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:1373
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
Definition: DeclBase.h:828
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
FieldDecl * getAnyMember() const
Definition: DeclCXX.h:2279
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:932
void * getAsOpaquePtr() const
Definition: Type.h:688
void VisitLabelStmt(const LabelStmt *Node)
An ordinary object is located at an address in memory.
Definition: Specifiers.h:141
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:3511
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4140
Represents an ObjC class declaration.
Definition: DeclObjC.h:1171
This is an odr-use.
Definition: Specifiers.h:162
Represents a linkage specification.
Definition: DeclCXX.h:2753
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:3225
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:3791
SplitQualType getSplitDesugaredType() const
Definition: Type.h:947
A binding in a decomposition declaration.
Definition: DeclCXX.h:3718
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:3166
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
param_iterator param_begin()
Definition: Decl.h:2337
Represents the this expression in C++.
Definition: ExprCXX.h:1097
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4289
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:576
StringRef getArg() const
Definition: Decl.h:164
bool isArrayForm() const
Definition: ExprCXX.h:2386
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:3335
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:4479
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:1524
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3107
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:3725
void VisitImplicitCastExpr(const ImplicitCastExpr *Node)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1494
QualType getComputationLHSType() const
Definition: Expr.h:3652
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:2234
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2347
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Node)
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:953
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:1103
This represents &#39;#pragma omp requires...&#39; directive.
Definition: DeclOpenMP.h:345
unsigned getValue() const
Definition: Expr.h:1539
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
Definition: Specifiers.h:151
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3064
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:2413
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3169
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:3951
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:644
StringRef getKindName() const
Definition: Decl.h:3308
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:2084
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:3592
Declaration of a template type parameter.
unsigned getIndex() const
Definition: Type.h:4640
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:6923
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why? This is only meaningful if the named memb...
Definition: Expr.h:3035
void VisitObjCSelectorExpr(const ObjCSelectorExpr *Node)
unsigned getLine() const
Return the presumed line number of this location.
void VisitOMPExecutableDirective(const OMPExecutableDirective *D)
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:167
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *Node)
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:558
TextNodeDumper(raw_ostream &OS, bool ShowColors, const SourceManager *SM, const PrintingPolicy &PrintPolicy, const comments::CommandTraits *Traits)
const char * getTypeClassName() const
Definition: Type.cpp:2754
QualType getArgumentType() const
Definition: Expr.h:2384
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:596
DeclContext * getDeclContext()
Definition: DeclBase.h:438
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:337
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
TLSKind getTLSKind() const
Definition: Decl.cpp:1983
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4091
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2402
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:3236
IdentifierInfo & getAccessor() const
Definition: Expr.h:5512
void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D)
decls_iterator decls_begin() const
Definition: ExprCXX.h:2936
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3252
bool isOMPStructuredBlock() const
Definition: Stmt.h:1103
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:582
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
Definition: Type.cpp:1931
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
QualType getType() const
Definition: Expr.h:137
static const TerminalColor ValueKindColor
StorageClass
Storage classes.
Definition: Specifiers.h:235
A unary type transform, which is a type constructed from another.
Definition: Type.h:4363
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:838
Qualifiers Quals
The local qualifiers.
Definition: Type.h:587
bool isDirectionExplicit() const LLVM_READONLY
Definition: Comment.h:749
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1779
LabelDecl * getLabel() const
Definition: Stmt.h:2478
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:2021
bool isInstanceMethod() const
Definition: DeclObjC.h:421
void dumpBareType(QualType T, bool Desugar=true)
Represents a GCC generic vector type.
Definition: Type.h:3206
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:2883
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
UTTKind getUTTKind() const
Definition: Type.h:4391
StringRef getName() const
Definition: Decl.h:196
ValueDecl * getDecl()
Definition: Expr.h:1222
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:2076
void VisitExprWithCleanups(const ExprWithCleanups *Node)
bool isNull() const
Return true if this QualType doesn&#39;t point to a type yet.
Definition: Type.h:708
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1314
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:657
const SourceManager & SM
Definition: Format.cpp:1667
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
static const char * getDirectionAsString(PassDirection D)
Definition: Comment.cpp:192
void VisitConstructorUsingShadowDecl(const ConstructorUsingShadowDecl *D)
void VisitCapturedDecl(const CapturedDecl *D)
APValue getAPValueResult() const
Definition: Expr.cpp:351
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3629
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *D)
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6156
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:3216
static StringRef getIdentKindName(IdentKind IK)
Definition: Expr.cpp:646
not a target-specific vector type
Definition: Type.h:3210
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:3781
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:3938
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:5827
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
bool isPure() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2059
void VisitDependentSizedArrayType(const DependentSizedArrayType *T)
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition: Stmt.h:2257
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:3539
void dumpPointer(const void *Ptr)
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:312
void VisitFixedPointLiteral(const FixedPointLiteral *Node)
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:5814
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2137
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D)
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:33
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:2100
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:377
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:476
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3494
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:3670
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1905
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:354
std::string getValueAsString(unsigned Radix) const
Definition: Expr.cpp:955
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:2064
No ref-qualifier was provided.
Definition: Type.h:1389
C-style initialization with assignment.
Definition: Decl.h:832
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:4641
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:2378
bool isArray() const
Definition: ExprCXX.h:2223
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3589
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:3219
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:3242
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:3249
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:702
void dumpDeclRef(const Decl *D, StringRef Label={})
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition: ExprObjC.h:737
is AltiVec vector
Definition: Type.h:3213
PassDirection getDirection() const LLVM_READONLY
Definition: Comment.h:745
void VisitCXXNewExpr(const CXXNewExpr *Node)
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:2887
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:398
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2749
VarDecl * getVariable() const
The variable being captured.
Definition: Decl.h:3978
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:1395
SourceRange getBracketsRange() const
Definition: Type.h:3092
void VisitPackExpansionType(const PackExpansionType *T)
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:124
bool isArgumentType() const
Definition: Expr.h:2383
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:5456
bool isPartOfExplicitCast() const
Definition: Expr.h:3268
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:2127
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:4245
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:799
protocol_range protocols() const
Definition: DeclObjC.h:2355
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1346
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5054
Represents a pack expansion of types.
Definition: Type.h:5431
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:3629
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:1935
void VisitArrayType(const ArrayType *T)
Represents a C11 generic selection.
Definition: Expr.h:5206
void VisitIntegerLiteral(const IntegerLiteral *Node)
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:3882
ast_type_traits::DynTypedNode Node
void dumpAccessSpecifier(AccessSpecifier AS)
TLS with a dynamic initializer.
Definition: Decl.h:850
Represents a template argument.
Definition: TemplateBase.h:50
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:586
bool isDeduced() const
Definition: Type.h:4812
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:170
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2439
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2704
Dataflow Directional Tag Classes.
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5386
ExtInfo getExtInfo() const
Definition: Type.h:3662
not evaluated yet, for special member function
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1878
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1271
static const TerminalColor AttrColor
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:2359
bool isNested() const
Whether this is a nested capture, i.e.
Definition: Decl.h:3994
bool isVariadic() const
Definition: Decl.h:4026
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2822
bool isImplicit() const
Definition: ExprCXX.h:1118
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition: Stmt.h:1889
Represents a field injected from an anonymous union/struct into the parent scope. ...
Definition: Decl.h:2894
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
QualType getUnderlyingType() const
Definition: Decl.h:3040
AccessSpecifier getAccess() const
Definition: DeclBase.h:473
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2735
unsigned getIndex() const
Retrieve the index of the template parameter.
bool usesADL() const
Definition: Expr.h:2648
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3657
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3590
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:3251
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
Definition: Type.h:979
Kind getKind() const
Definition: DeclBase.h:432
void VisitUnresolvedUsingType(const UnresolvedUsingType *T)
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1513
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
Definition: DeclCXX.cpp:2400
void VisitDeclRefExpr(const DeclRefExpr *Node)
Represents an enum.
Definition: Decl.h:3395
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack...
Definition: Decl.cpp:2449
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:1405
LabelDecl * getLabel() const
Definition: Expr.h:3904
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:3198
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:2027
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class...
Definition: DeclCXX.h:864
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:3795
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:4444
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:2137
unsigned getNumObjects() const
Definition: ExprCXX.h:3337
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:1854
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:2929
static const TerminalColor TypeColor
Opcode getOpcode() const
Definition: Expr.h:2046
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:2721
static const TerminalColor DeclKindNameColor
SourceRange getBracketsRange() const
Definition: Type.h:3035
static const char * getCastKindName(CastKind CK)
Definition: Expr.cpp:1882
bool isVolatile() const
Definition: Type.h:3669
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:3618
Represents a base class of a C++ class.
Definition: DeclCXX.h:147
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:144
void VisitCharacterLiteral(const CharacterLiteral *Node)
void VisitConceptDecl(const ConceptDecl *D)
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:546
bool capturesCXXThis() const
Definition: Decl.h:4083
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3390
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2465
void VisitBinaryOperator(const BinaryOperator *Node)
TypedefNameDecl * getDecl() const
Definition: Type.h:4206
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
unsigned getDepth() const
Definition: Type.h:4639
bool isFreeIvar() const
Definition: ExprObjC.h:585
Call-style initialization (C++98)
Definition: Decl.h:835
void dumpName(const NamedDecl *ND)
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2811
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:2718
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:255
const char * getCommentKindName() const
Definition: Comment.cpp:35
bool isValid() const
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
Definition: Decl.h:1360
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:1688
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1944
There is no such object (it&#39;s outside its lifetime).
Definition: APValue.h:121
WhileStmt - This represents a &#39;while&#39; stmt.
Definition: Stmt.h:2210
void dumpBareDeclRef(const Decl *D)
CleanupObject getObject(unsigned i) const
Definition: ExprCXX.h:3339
bool isInherited() const
Definition: Attr.h:94
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:262
bool isGlobalDelete() const
Definition: ExprCXX.h:2385
void VisitObjCInterfaceType(const ObjCInterfaceType *T)
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1686
void dumpType(QualType T)
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2521
TLS with a known-constant initializer.
Definition: Decl.h:847
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3549
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:3318
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:3261
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:353
unsigned getNumElements() const
Definition: Type.h:3242
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:2121
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:1146
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:4917
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:2199
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:763
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4487
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:3425
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:2934
QualType getType() const
Definition: Decl.h:655
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:129
void VisitNamespaceDecl(const NamespaceDecl *D)
void VisitAutoType(const AutoType *T)
void VisitConstantExpr(const ConstantExpr *Node)
static const TerminalColor AddressColor
A trivial tuple used to represent a source range.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
Definition: DeclBase.h:607
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to...
Definition: Expr.cpp:1291
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:921
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:2843
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:645
StringRef getParamName(const FullComment *FC) const
Definition: Comment.cpp:378
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3010
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
Represents a C++ namespace alias.
Definition: DeclCXX.h:2949
APValue::ValueKind getResultAPValueKind() const
Definition: Expr.h:1025
void VisitCXXThisExpr(const CXXThisExpr *Node)
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1399
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:2845
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:994
attr::Kind getKind() const
Definition: Attr.h:85
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:3178
bool hasInit() const
Definition: Decl.cpp:2211
SourceLocation getBegin() const
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4162
decls_iterator decls_end() const
Definition: ExprCXX.h:2939
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:1557
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2906
This class handles loading and caching of source files into memory.
The parameter is invariant: must match exactly.
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:3811
void VisitUnaryOperator(const UnaryOperator *Node)
void VisitLabelDecl(const LabelDecl *D)
Declaration of a template function.
Definition: DeclTemplate.h:961
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:45
bool isDeletedAsWritten() const
Definition: Decl.h:2203
SourceLocation getLocation() const
Definition: DeclBase.h:429
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D)
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Definition: DeclCXX.h:3068
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:3045
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:162
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2728
bool param_empty() const
Definition: Decl.h:2336
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:246
void VisitRValueReferenceType(const ReferenceType *T)