clang  8.0.0svn
Macros | Functions
ASTDumper.cpp File Reference
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDumperUtils.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CommentVisitor.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclLookups.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/LocInfoType.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TextNodeDumper.h"
#include "clang/AST/TypeVisitor.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/raw_ostream.h"
#include "clang/Basic/AttrList.inc"
#include "clang/AST/AttrDump.inc"
#include "clang/AST/DeclNodes.inc"
Include dependency graph for ASTDumper.cpp:

Go to the source code of this file.

Macros

#define ATTR(X)   case attr::X: OS << #X; break;
 
#define DECL(DERIVED, BASE)
 
#define ABSTRACT_DECL(DECL)
 
#define FLAG(fn, name)   if (D->fn()) OS << " " #name;
 

Functions

static void dumpPreviousDeclImpl (raw_ostream &OS,...)
 
template<typename T >
static void dumpPreviousDeclImpl (raw_ostream &OS, const Mergeable< T > *D)
 
template<typename T >
static void dumpPreviousDeclImpl (raw_ostream &OS, const Redeclarable< T > *D)
 
static void dumpPreviousDecl (raw_ostream &OS, const Decl *D)
 Dump the previous declaration in the redeclaration chain for a declaration, if any. More...
 
static void dumpBasePath (raw_ostream &OS, const CastExpr *Node)
 

Macro Definition Documentation

◆ ABSTRACT_DECL

#define ABSTRACT_DECL (   DECL)

◆ ATTR

#define ATTR (   X)    case attr::X: OS << #X; break;

◆ DECL

#define DECL (   DERIVED,
  BASE 
)
Value:
case Decl::DERIVED: \
return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
static void dumpPreviousDeclImpl(raw_ostream &OS,...)
Definition: ASTDumper.cpp:611

◆ FLAG

#define FLAG (   fn,
  name 
)    if (D->fn()) OS << " " #name;

Referenced by dumpPreviousDecl().

Function Documentation

◆ dumpBasePath()

static void dumpBasePath ( raw_ostream &  OS,
const CastExpr Node 
)
static

Definition at line 1842 of file ASTDumper.cpp.

References clang::UnaryOperator::canOverflow(), clang::CastColor, clang::comments::Comment::child_begin(), clang::comments::Comment::child_end(), clang::ObjCMessageExpr::Class, clang::DeclKindNameColor, clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::TextNodeDumper::dumpBareDeclRef(), clang::TextNodeDumper::dumpBareType(), clang::TextNodeDumper::dumpCXXTemporary(), clang::TextNodeDumper::dumpName(), clang::TextNodeDumper::dumpPointer(), clang::TextNodeDumper::dumpType(), clang::First, clang::ExtVectorElementExpr::getAccessor(), clang::UnaryExprOrTypeTraitExpr::getArgumentType(), clang::InitListExpr::getArrayFiller(), clang::Type::getAs(), clang::GenericSelectionExpr::getAssocExpr(), clang::GenericSelectionExpr::getAssocTypeSourceInfo(), clang::QualType::getAsString(), clang::ObjCSubscriptRefExpr::getAtIndexMethodDecl(), clang::BlockExpr::getBlockDecl(), clang::ObjCBoxedExpr::getBoxingMethod(), clang::CastExpr::getCastKindName(), clang::CXXNamedCastExpr::getCastName(), clang::ObjCAtCatchStmt::getCatchParamDecl(), clang::ObjCMessageExpr::getClassReceiver(), clang::CompoundAssignOperator::getComputationLHSType(), clang::CompoundAssignOperator::getComputationResultType(), clang::CXXConstructExpr::getConstructor(), clang::GenericSelectionExpr::getControllingExpr(), clang::ObjCIvarRefExpr::getDecl(), clang::DeclRefExpr::getDecl(), clang::Decl::getDeclKindName(), clang::ObjCEncodeExpr::getEncodedType(), clang::ObjCPropertyRefExpr::getExplicitProperty(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::DeclRefExpr::getFoundDecl(), clang::PredefinedExpr::getIdentKind(), clang::PredefinedExpr::getIdentKindName(), clang::ObjCPropertyRefExpr::getImplicitPropertyGetter(), clang::ObjCPropertyRefExpr::getImplicitPropertySetter(), clang::InitListExpr::getInitializedFieldInUnion(), clang::UnaryExprOrTypeTraitExpr::getKind(), clang::AddrLabelExpr::getLabel(), clang::CXXDependentScopeMemberExpr::getMember(), clang::MemberExpr::getMemberDecl(), clang::NamedDecl::getName(), clang::OverloadExpr::getName(), clang::IdentifierInfo::getNameStart(), clang::GenericSelectionExpr::getNumAssocs(), clang::ExprWithCleanups::getNumObjects(), clang::ExprWithCleanups::getObject(), clang::UnaryOperator::getOpcode(), clang::BinaryOperator::getOpcode(), clang::UnaryOperator::getOpcodeStr(), clang::BinaryOperator::getOpcodeStr(), clang::CXXDeleteExpr::getOperatorDelete(), clang::CXXNewExpr::getOperatorNew(), clang::SizeOfPackExpr::getPack(), clang::SizeOfPackExpr::getPartialArguments(), clang::ObjCProtocolExpr::getProtocol(), clang::ObjCMessageExpr::getReceiverKind(), clang::GenericSelectionExpr::getResultIndex(), clang::ObjCMethodDecl::getSelector(), clang::ObjCSelectorExpr::getSelector(), clang::ObjCMessageExpr::getSelector(), clang::OpaqueValueExpr::getSourceExpr(), clang::CXXBindTemporaryExpr::getTemporary(), clang::Expr::getType(), clang::CXXBaseSpecifier::getType(), clang::ValueDecl::getType(), clang::CXXUnresolvedConstructExpr::getTypeAsWritten(), clang::ExplicitCastExpr::getTypeAsWritten(), clang::ObjCBoolLiteralExpr::getValue(), clang::CXXBoolLiteralExpr::getValue(), clang::APIntStorage::getValue(), clang::CharacterLiteral::getValue(), clang::FloatingLiteral::getValueAsApproximateDouble(), clang::FixedPointLiteral::getValueAsString(), clang::ObjCMessageExpr::Instance, clang::UnaryExprOrTypeTraitExpr::isArgumentType(), clang::CXXNewExpr::isArray(), clang::CXXDeleteExpr::isArrayForm(), clang::ObjCSubscriptRefExpr::isArraySubscriptRefExpr(), clang::MemberExpr::isArrow(), clang::CXXDependentScopeMemberExpr::isArrow(), clang::CXXConstructExpr::isElidable(), clang::ObjCIvarRefExpr::isFreeIvar(), clang::CXXDeleteExpr::isGlobalDelete(), clang::CXXNewExpr::isGlobalNew(), clang::ObjCPropertyRefExpr::isImplicitProperty(), clang::CXXConstructExpr::isListInitialization(), clang::CXXUnresolvedConstructExpr::isListInitialization(), clang::ObjCPropertyRefExpr::isMessagingGetter(), clang::ObjCPropertyRefExpr::isMessagingSetter(), clang::SizeOfPackExpr::isPartiallySubstituted(), clang::ImplicitCastExpr::isPartOfExplicitCast(), clang::UnaryOperator::isPostfix(), clang::GenericSelectionExpr::isResultDependent(), clang::Type::isSignedIntegerType(), clang::CXXConstructExpr::isStdInitListInitialization(), clang::ObjCPropertyRefExpr::isSuperReceiver(), clang::CXXBaseSpecifier::isVirtual(), clang::StringLiteral::outputString(), clang::CastExpr::path_begin(), clang::CastExpr::path_empty(), clang::CastExpr::path_end(), clang::Selector::print(), clang::UnresolvedLookupExpr::requiresADL(), clang::CXXConstructExpr::requiresZeroInitialization(), clang::ObjCSubscriptRefExpr::setAtIndexMethodDecl(), clang::ObjCMessageExpr::SuperClass, clang::ObjCMessageExpr::SuperInstance, clang::UETT_AlignOf, clang::UETT_OpenMPRequiredSimdAlign, clang::UETT_PreferredAlignOf, clang::UETT_SizeOf, clang::UETT_VecStep, clang::ValueColor, clang::comments::CommentVisitorBase< llvm::make_const_ptr, ImplClass, RetTy, ParamTys... >::visit(), and clang::TextNodeDumper::Visit().

◆ dumpPreviousDecl()

static void dumpPreviousDecl ( raw_ostream &  OS,
const Decl D 
)
static

Dump the previous declaration in the redeclaration chain for a declaration, if any.

Definition at line 629 of file ASTDumper.cpp.

References clang::Decl::attr_begin(), clang::Decl::attr_end(), clang::AttrColor, clang::CXXRecordDecl::bases(), clang::TemplateParameterList::begin(), clang::DecompositionDecl::bindings(), clang::OMPDeclareReductionDecl::CallInit, clang::VarDecl::CallInit, canPassInRegisters(), clang::BlockDecl::captures(), clang::BlockDecl::capturesCXXThis(), clang::IndirectFieldDecl::chain(), clang::VarDecl::CInit, clang::OMPRequiresDecl::clauselists(), clang::ConstructorUsingShadowDecl::constructsVirtualBase(), clang::Contravariant, clang::OMPDeclareReductionDecl::CopyInit, clang::Covariant, clang::TemplateArgument::Declaration, clang::DeclKindNameColor, clang::DeclContext::decls_begin(), clang::DeclContext::decls_end(), clang::TemplateTypeParmDecl::defaultArgumentWasInherited(), clang::NonTypeTemplateParmDecl::defaultArgumentWasInherited(), clang::TemplateTemplateParmDecl::defaultArgumentWasInherited(), clang::OMPDeclareReductionDecl::DirectInit, clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::TemplateName::dump(), clang::TextNodeDumper::dumpAccessSpecifier(), clang::TextNodeDumper::dumpBareDeclRef(), clang::TextNodeDumper::dumpLocation(), clang::TextNodeDumper::dumpName(), clang::TextNodeDumper::dumpPointer(), clang::TextNodeDumper::dumpSourceRange(), clang::TextNodeDumper::dumpType(), clang::TemplateParameterList::end(), clang::EST_Unevaluated, clang::EST_Uninstantiated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::TemplateArgument::Expression, FLAG, clang::Decl::getAccess(), clang::ObjCIvarDecl::getAccessControl(), clang::NamespaceAliasDecl::getAliasedNamespace(), clang::CXXCtorInitializer::getAnyMember(), clang::PragmaCommentDecl::getArg(), clang::TemplateArgumentLoc::getArgument(), clang::Type::getAs(), clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsIntegral(), clang::FileScopeAsmDecl::getAsmString(), clang::StaticAssertDecl::getAssertExpr(), clang::QualType::getAsString(), clang::Decl::getASTContext(), clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::CXXCtorInitializer::getBaseClass(), clang::BindingDecl::getBinding(), clang::FieldDecl::getBitWidth(), clang::ObjCMethodDecl::getBody(), clang::FunctionDecl::getBody(), clang::BlockDecl::getBody(), clang::CapturedDecl::getBody(), clang::ObjCCategoryImplDecl::getCategoryDecl(), clang::ObjCCategoryDecl::getClassInterface(), clang::ObjCImplDecl::getClassInterface(), clang::ObjCCompatibleAliasDecl::getClassInterface(), clang::OMPDeclareReductionDecl::getCombiner(), clang::PragmaCommentDecl::getCommentKind(), clang::ConstructorUsingShadowDecl::getConstructedBaseClass(), clang::ConstructorUsingShadowDecl::getConstructedBaseClassShadowDecl(), clang::Decl::getDeclContext(), clang::Decl::getDeclKindName(), clang::TemplateTypeParmDecl::getDefaultArgStorage(), clang::NonTypeTemplateParmDecl::getDefaultArgStorage(), clang::TemplateTemplateParmDecl::getDefaultArgStorage(), clang::TemplateTypeParmDecl::getDefaultArgument(), clang::NonTypeTemplateParmDecl::getDefaultArgument(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateParmPosition::getDepth(), clang::TemplateTypeParmDecl::getDepth(), clang::FriendDecl::getFriendDecl(), clang::FriendDecl::getFriendType(), clang::Module::getFullModuleName(), clang::ObjCPropertyDecl::getGetterMethodDecl(), clang::ObjCInterfaceDecl::getImplementation(), clang::ObjCCategoryDecl::getImplementation(), clang::ImportDecl::getImportedModule(), clang::FieldDecl::getInClassInitializer(), clang::TemplateParmPosition::getIndex(), clang::TemplateTypeParmDecl::getIndex(), clang::DefaultArgStorage< ParmDecl, ArgType >::getInheritedFrom(), clang::VarDecl::getInit(), clang::CXXCtorInitializer::getInit(), clang::EnumConstantDecl::getInitExpr(), clang::OMPDeclareReductionDecl::getInitializer(), clang::OMPDeclareReductionDecl::getInitializerKind(), clang::VarDecl::getInitStyle(), clang::EnumDecl::getIntegerType(), clang::TemplateArgument::getKind(), clang::Decl::getKind(), clang::TagDecl::getKindName(), clang::LinkageSpecDecl::getLanguage(), clang::Decl::getLexicalDeclContext(), clang::ASTContext::getLocalCommentForDeclUncached(), clang::Decl::getLocation(), clang::StaticAssertDecl::getMessage(), clang::ASTContext::getModulesWithMergedDefinition(), clang::PragmaDetectMismatchDecl::getName(), clang::NamedDecl::getNameAsString(), clang::ConstructorUsingShadowDecl::getNominatedBaseClass(), clang::ConstructorUsingShadowDecl::getNominatedBaseClassShadowDecl(), clang::UsingDirectiveDecl::getNominatedNamespace(), clang::FunctionDecl::getNumParams(), clang::getOpenMPClauseName(), clang::NamespaceDecl::getOriginalNamespace(), clang::Decl::getOwningModule(), clang::DeclContext::getParent(), clang::ASTContext::getPrintingPolicy(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::ObjCPropertyDecl::getPropertyImplementation(), clang::ObjCPropertyImplDecl::getPropertyImplementation(), clang::ObjCPropertyImplDecl::getPropertyIvarDecl(), clang::UsingDecl::getQualifier(), clang::UnresolvedUsingValueDecl::getQualifier(), clang::UnresolvedUsingTypenameDecl::getQualifier(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCPropertyDecl::getSetterMethodDecl(), clang::Decl::getSourceRange(), clang::TemplateArgumentLoc::getSourceRange(), clang::ClassScopeFunctionSpecializationDecl::getSpecialization(), clang::VarDecl::getStorageClass(), clang::FunctionDecl::getStorageClass(), clang::VarDecl::getStorageClassSpecifierString(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ObjCImplementationDecl::getSuperClass(), clang::ObjCIvarDecl::getSynthesize(), clang::UsingShadowDecl::getTargetDecl(), clang::ClassTemplateSpecializationDecl::getTemplateArgs(), clang::VarTemplateSpecializationDecl::getTemplateArgs(), clang::TemplateDecl::getTemplatedDecl(), clang::TypeAliasTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ClassTemplatePartialSpecializationDecl::getTemplateParameters(), clang::VarTemplatePartialSpecializationDecl::getTemplateParameters(), clang::FunctionDecl::getTemplateSpecializationInfo(), clang::VarDecl::getTLSKind(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::ObjCPropertyDecl::getType(), clang::ObjCCategoryDecl::getTypeParamList(), clang::ObjCInterfaceDecl::getTypeParamListAsWritten(), clang::CXXCtorInitializer::getTypeSourceInfo(), clang::NamedDecl::getUnderlyingDecl(), clang::TypedefNameDecl::getUnderlyingType(), clang::PragmaDetectMismatchDecl::getValue(), clang::ObjCTypeParamDecl::getVariance(), clang::ObjCMethodDecl::hasBody(), clang::TemplateTypeParmDecl::hasDefaultArgument(), clang::NonTypeTemplateParmDecl::hasDefaultArgument(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), clang::ObjCTypeParamDecl::hasExplicitBound(), clang::ClassScopeFunctionSpecializationDecl::hasExplicitTemplateArgs(), clang::DeclContext::hasExternalLexicalStorage(), clang::VarDecl::hasInit(), clang::ObjCImplementationDecl::init_begin(), clang::ObjCImplementationDecl::init_end(), clang::TemplateArgument::Integral, clang::Invariant, clang::CXXCtorInitializer::isAnyMemberInitializer(), clang::CXXCtorInitializer::isBaseInitializer(), clang::FieldDecl::isBitField(), clang::Decl::isCanonicalDecl(), clang::TagDecl::isCompleteDefinition(), clang::VarDecl::isConstexpr(), clang::FunctionDecl::isDefaulted(), clang::CXXCtorInitializer::isDelegatingInitializer(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDeletedAsWritten(), clang::EnumDecl::isFixed(), clang::Decl::isFromASTFile(), clang::Decl::isImplicit(), clang::NamespaceDecl::isInline(), clang::VarDecl::isInline(), clang::FunctionDecl::isInlineSpecified(), clang::ObjCMethodDecl::isInstanceMethod(), clang::Decl::isInvalidDecl(), clang::tok::isLiteral(), clang::Decl::isModulePrivate(), clang::FieldDecl::isMutable(), clang::VarDecl::isNRVOVariable(), clang::NamespaceDecl::isOriginalNamespace(), clang::TemplateTypeParmDecl::isParameterPack(), clang::NonTypeTemplateParmDecl::isParameterPack(), clang::TemplateTemplateParmDecl::isParameterPack(), clang::FunctionDecl::isPure(), clang::EnumDecl::isScoped(), clang::EnumDecl::isScopedUsingClassTag(), clang::ObjCMethodDecl::isThisDeclarationADefinition(), clang::Decl::isThisDeclarationReferenced(), isTrivial(), clang::FunctionDecl::isTrivial(), clang::Decl::isUsed(), clang::SourceRange::isValid(), clang::ObjCMethodDecl::isVariadic(), clang::BlockDecl::isVariadic(), clang::FunctionDecl::isVirtualAsWritten(), clang::LinkageSpecDecl::lang_c, clang::LinkageSpecDecl::lang_cxx, clang::VarDecl::ListInit, clang::CXXRecordDecl::needsOverloadResolutionForCopyConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForDestructor(), clang::CXXRecordDecl::needsOverloadResolutionForMoveConstructor(), clang::DeclContext::noload_decls_begin(), clang::DeclContext::noload_decls_end(), clang::ObjCIvarDecl::None, clang::TemplateArgument::Null, clang::NullColor, clang::TemplateArgument::NullPtr, clang::ObjCPropertyDecl::OBJC_PR_assign, clang::ObjCPropertyDecl::OBJC_PR_atomic, clang::ObjCPropertyDecl::OBJC_PR_class, clang::ObjCPropertyDecl::OBJC_PR_copy, clang::ObjCPropertyDecl::OBJC_PR_getter, clang::ObjCPropertyDecl::OBJC_PR_noattr, clang::ObjCPropertyDecl::OBJC_PR_nonatomic, clang::ObjCPropertyDecl::OBJC_PR_readonly, clang::ObjCPropertyDecl::OBJC_PR_readwrite, clang::ObjCPropertyDecl::OBJC_PR_retain, clang::ObjCPropertyDecl::OBJC_PR_setter, clang::ObjCPropertyDecl::OBJC_PR_strong, clang::ObjCPropertyDecl::OBJC_PR_unsafe_unretained, clang::ObjCPropertyDecl::OBJC_PR_weak, clang::ObjCPropertyDecl::Optional, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_end(), clang::ObjCIvarDecl::Package, clang::FunctionDecl::param_begin(), clang::Parameter, clang::ObjCMethodDecl::parameters(), clang::FunctionDecl::parameters(), clang::BlockDecl::parameters(), clang::PCK_Compiler, clang::PCK_ExeStr, clang::PCK_Lib, clang::PCK_Linker, clang::PCK_Unknown, clang::PCK_User, clang::NestedNameSpecifier::print(), clang::ObjCIvarDecl::Private, clang::ObjCIvarDecl::Protected, clang::ObjCCategoryDecl::protocol_begin(), clang::ObjCCategoryDecl::protocol_end(), clang::ObjCInterfaceDecl::protocols(), clang::ObjCProtocolDecl::protocols(), clang::ObjCIvarDecl::Public, clang::ObjCPropertyDecl::Required, clang::SC_None, clang::TemplateArgumentList::size(), clang::TemplateArgumentListInfo::size(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionProtoType::ExceptionSpecInfo::SourceTemplate, clang::QualType::split(), clang::ObjCPropertyImplDecl::Synthesize, clang::TemplateArgument::Template, clang::ClassScopeFunctionSpecializationDecl::templateArgs(), clang::TemplateArgument::TemplateExpansion, clang::VarDecl::TLS_Dynamic, clang::VarDecl::TLS_None, clang::VarDecl::TLS_Static, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, clang::TemplateArgument::Type, clang::FunctionProtoType::ExceptionSpecInfo::Type, clang::OMPThreadPrivateDecl::varlists(), clang::declvisitor::Base< llvm::make_const_ptr, ImplClass, RetTy >::Visit(), and clang::TemplateTypeParmDecl::wasDeclaredWithTypename().

◆ dumpPreviousDeclImpl() [1/3]

static void dumpPreviousDeclImpl ( raw_ostream &  OS,
  ... 
)
static

Definition at line 611 of file ASTDumper.cpp.

◆ dumpPreviousDeclImpl() [2/3]

template<typename T >
static void dumpPreviousDeclImpl ( raw_ostream &  OS,
const Mergeable< T > *  D 
)
static

Definition at line 614 of file ASTDumper.cpp.

References clang::First, and clang::Mergeable< decl_type >::getFirstDecl().

◆ dumpPreviousDeclImpl() [3/3]

template<typename T >
static void dumpPreviousDeclImpl ( raw_ostream &  OS,
const Redeclarable< T > *  D 
)
static