clang  9.0.0svn
Macros | Functions
CGDebugInfo.cpp File Reference
#include "CGDebugInfo.h"
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGObjCRuntime.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "ConstantEmitter.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclFriend.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Version.h"
#include "clang/Frontend/FrontendOptions.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "clang/Lex/ModuleMap.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/Path.h"
#include "clang/AST/BuiltinTypes.def"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/AST/TypeNodes.def"
Include dependency graph for CGDebugInfo.cpp:

Go to the source code of this file.

Macros

#define BUILTIN_TYPE(Id, SingletonId)
 
#define PLACEHOLDER_TYPE(Id, SingletonId)   case BuiltinType::Id:
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
 
#define TYPE(Class, Base)
 
#define ABSTRACT_TYPE(Class, Base)
 
#define NON_CANONICAL_TYPE(Class, Base)
 
#define DEPENDENT_TYPE(Class, Base)   case Type::Class:
 

Functions

static uint32_t getTypeAlignIfRequired (const Type *Ty, const ASTContext &Ctx)
 
static uint32_t getTypeAlignIfRequired (QualType Ty, const ASTContext &Ctx)
 
static uint32_t getDeclAlignIfRequired (const Decl *D, const ASTContext &Ctx)
 
static bool hasCXXMangling (const TagDecl *TD, llvm::DICompileUnit *TheCU)
 
static bool needsTypeIdentifier (const TagDecl *TD, CodeGenModule &CGM, llvm::DICompileUnit *TheCU)
 
static SmallString< 256 > getTypeIdentifier (const TagType *Ty, CodeGenModule &CGM, llvm::DICompileUnit *TheCU)
 
static llvm::dwarf::Tag getTagForRecord (const RecordDecl *RD)
 
static unsigned getDwarfCC (CallingConv CC)
 
static llvm::DINode::DIFlags getAccessFlag (AccessSpecifier Access, const RecordDecl *RD)
 Convert an AccessSpecifier into the corresponding DINode flag. More...
 
static bool isFunctionLocalClass (const CXXRecordDecl *RD)
 isFunctionLocalClass - Return true if CXXRecordDecl is defined inside a function. More...
 
static bool isClassOrMethodDLLImport (const CXXRecordDecl *RD)
 Return true if the class or any of its methods are marked dllimport. More...
 
static bool isDefinedInClangModule (const RecordDecl *RD)
 Does a type definition exist in an imported clang module? More...
 
static bool hasExplicitMemberDefinition (CXXRecordDecl::method_iterator I, CXXRecordDecl::method_iterator End)
 
static bool shouldOmitDefinition (codegenoptions::DebugInfoKind DebugKind, bool DebugTypeExtRefs, const RecordDecl *RD, const LangOptions &LangOpts)
 
static bool hasDefaultGetterName (const ObjCPropertyDecl *PD, const ObjCMethodDecl *Getter)
 
static bool hasDefaultSetterName (const ObjCPropertyDecl *PD, const ObjCMethodDecl *Setter)
 
static QualType UnwrapTypeForDebugInfo (QualType T, const ASTContext &C)
 

Macro Definition Documentation

◆ ABSTRACT_TYPE

#define ABSTRACT_TYPE (   Class,
  Base 
)

◆ BUILTIN_TYPE

#define BUILTIN_TYPE (   Id,
  SingletonId 
)

◆ DEPENDENT_TYPE

#define DEPENDENT_TYPE (   Class,
  Base 
)    case Type::Class:

◆ EXT_OPAQUE_TYPE

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)
Value:
return getOrCreateStructPtrType("opencl_" #ExtType, Id##Ty);
int Id
Definition: ASTDiff.cpp:190

◆ IMAGE_TYPE

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)
Value:
return getOrCreateStructPtrType("opencl_" #ImgType "_" #Suffix "_t", \
SingletonId);
int Id
Definition: ASTDiff.cpp:190

◆ NON_CANONICAL_TYPE

#define NON_CANONICAL_TYPE (   Class,
  Base 
)

◆ PLACEHOLDER_TYPE

#define PLACEHOLDER_TYPE (   Id,
  SingletonId 
)    case BuiltinType::Id:

◆ TYPE

#define TYPE (   Class,
  Base 
)

Function Documentation

◆ getAccessFlag()

static llvm::DINode::DIFlags getAccessFlag ( AccessSpecifier  Access,
const RecordDecl RD 
)
static

Convert an AccessSpecifier into the corresponding DINode flag.

As an optimization, return 0 if the access specifier equals the default for the containing type.

Definition at line 1187 of file CGDebugInfo.cpp.

References clang::AS_none, clang::AS_private, clang::AS_protected, clang::AS_public, clang::CXXRecordDecl::captures_begin(), clang::CXXRecordDecl::captures_end(), clang::LambdaCapture::capturesThis(), clang::LambdaCapture::capturesVariable(), clang::DeclContext::decls(), clang::Default, clang::VarDecl::evaluateValue(), clang::RecordDecl::field_begin(), clang::Decl::getAccess(), clang::Type::getAs(), clang::QualType::getAsOpaquePtr(), clang::FunctionType::getCallConv(), clang::VarDecl::getCanonicalDecl(), clang::LambdaCapture::getCapturedVar(), getDeclAlignIfRequired(), getDwarfCC(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTRecordLayout::getFieldOffset(), clang::APValue::getFloat(), clang::VarDecl::getInit(), clang::APValue::getInt(), clang::LambdaCapture::getLocation(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::Type::getPointeeCXXRecordDecl(), clang::PointerType::getPointeeType(), clang::CXXMethodDecl::getThisType(), clang::ValueDecl::getType(), getTypeAlignIfRequired(), clang::FieldDecl::isBitField(), clang::TagDecl::isClass(), clang::APValue::isFloat(), clang::Type::isIncompleteArrayType(), clang::APValue::isInt(), clang::CXXRecordDecl::isLambda(), clang::Type::isRecordType(), clang::CXXMethodDecl::isStatic(), clang::TagDecl::isStruct(), clang::TagDecl::isUnion(), Line, clang::CodeGen::CGBitFieldInfo::Offset, Offset, clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::RQ_LValue, clang::RQ_RValue, clang::CodeGen::CGBitFieldInfo::Size, clang::CodeGen::CGBitFieldInfo::StorageOffset, clang::CodeGen::CGBitFieldInfo::StorageSize, V, and clang::TypeInfo::Width.

Referenced by isFunctionLocalClass().

◆ getDeclAlignIfRequired()

static uint32_t getDeclAlignIfRequired ( const Decl D,
const ASTContext Ctx 
)
static

◆ getDwarfCC()

static unsigned getDwarfCC ( CallingConv  CC)
static

◆ getTagForRecord()

static llvm::dwarf::Tag getTagForRecord ( const RecordDecl RD)
static

◆ getTypeAlignIfRequired() [1/2]

static uint32_t getTypeAlignIfRequired ( const Type Ty,
const ASTContext Ctx 
)
static

◆ getTypeAlignIfRequired() [2/2]

static uint32_t getTypeAlignIfRequired ( QualType  Ty,
const ASTContext Ctx 
)
static

Definition at line 56 of file CGDebugInfo.cpp.

References getTypeAlignIfRequired(), and clang::QualType::getTypePtr().

◆ getTypeIdentifier()

static SmallString<256> getTypeIdentifier ( const TagType Ty,
CodeGenModule CGM,
llvm::DICompileUnit *  TheCU 
)
static

◆ hasCXXMangling()

static bool hasCXXMangling ( const TagDecl TD,
llvm::DICompileUnit *  TheCU 
)
static
Returns
whether a C++ mangling exists for the type defined by TD.

Definition at line 861 of file CGDebugInfo.cpp.

Referenced by needsTypeIdentifier().

◆ hasDefaultGetterName()

static bool hasDefaultGetterName ( const ObjCPropertyDecl PD,
const ObjCMethodDecl Getter 
)
static

◆ hasDefaultSetterName()

static bool hasDefaultSetterName ( const ObjCPropertyDecl PD,
const ObjCMethodDecl Setter 
)
static
Returns
true if Setter has the default name for the property PD.

Definition at line 2281 of file CGDebugInfo.cpp.

References clang::ObjCInterfaceDecl::all_declared_ivar_begin(), clang::SelectorTable::constructSetterName(), clang::EnumDecl::enumerators(), clang::Type::getAs(), clang::QualType::getAsOpaquePtr(), clang::ExternalASTSource::ASTSourceDescriptor::getASTFile(), clang::MemberPointerType::getClass(), clang::EnumType::getDecl(), clang::ObjCInterfaceType::getDecl(), getDeclAlignIfRequired(), clang::NamedDecl::getDeclName(), clang::ObjCInterfaceDecl::getDefinition(), clang::EnumDecl::getDefinition(), clang::ArrayType::getElementType(), clang::VectorType::getElementType(), clang::PipeType::getElementType(), clang::ASTRecordLayout::getFieldOffset(), clang::ObjCInterfaceDecl::getImplementation(), clang::APValue::getInt(), clang::EnumDecl::getIntegerType(), clang::Decl::getLocation(), clang::ExternalASTSource::ASTSourceDescriptor::getModuleName(), clang::ExternalASTSource::ASTSourceDescriptor::getModuleOrNull(), clang::MemberPointerType::getMostRecentCXXRecordDecl(), clang::CXXRecordDecl::getMSInheritanceModel(), clang::NamedDecl::getName(), clang::Selector::getNameForSlot(), clang::VectorType::getNumElements(), clang::DeclarationName::getObjCSelector(), clang::ExternalASTSource::ASTSourceDescriptor::getPath(), clang::ReferenceType::getPointeeType(), clang::MemberPointerType::getPointeeType(), clang::ExternalASTSource::ASTSourceDescriptor::getSignature(), clang::ObjCInterfaceDecl::getSuperClass(), clang::CXXMethodDecl::getThisType(), getTypeAlignIfRequired(), clang::TypeDecl::getTypeForDecl(), getTypeIdentifier(), clang::AtomicType::getValueType(), hasDefaultGetterName(), Identifier, clang::Decl::isFromASTFile(), clang::Type::isIncompleteArrayType(), clang::Type::isIncompleteType(), clang::Type::isMemberDataPointerType(), clang::DeclarationName::isObjCOneArgSelector(), clang::EnumDecl::isScoped(), clang::Type::isSignedIntegerType(), clang::ObjCInterfaceDecl::known_extensions(), Line, clang::Module::Name, clang::Module::Parent, Parent, clang::ObjCIvarDecl::Private, clang::ObjCContainerDecl::properties(), clang::ObjCIvarDecl::Protected, clang::ObjCIvarDecl::Public, and clang::Expr::EvalResult::Val.

◆ hasExplicitMemberDefinition()

static bool hasExplicitMemberDefinition ( CXXRecordDecl::method_iterator  I,
CXXRecordDecl::method_iterator  End 
)
static

◆ isClassOrMethodDLLImport()

static bool isClassOrMethodDLLImport ( const CXXRecordDecl RD)
static

Return true if the class or any of its methods are marked dllimport.

Definition at line 2045 of file CGDebugInfo.cpp.

References clang::Decl::hasAttr(), and clang::CXXRecordDecl::methods().

Referenced by clang::CodeGen::CGDebugInfo::completeClassData(), and shouldOmitDefinition().

◆ isDefinedInClangModule()

static bool isDefinedInClangModule ( const RecordDecl RD)
static

◆ isFunctionLocalClass()

static bool isFunctionLocalClass ( const CXXRecordDecl RD)
static

isFunctionLocalClass - Return true if CXXRecordDecl is defined inside a function.

Definition at line 1494 of file CGDebugInfo.cpp.

References clang::TemplateParameterList::asArray(), clang::TemplateArgumentList::asArray(), clang::AtExit, clang::CXXRecordDecl::bases(), clang::TemplateArgument::Declaration, clang::DeclContext::decls(), clang::Dtor_Deleting, clang::CodeGen::ConstantEmitter::emitAbstract(), clang::TemplateArgument::Expression, clang::Decl::getAccess(), getAccessFlag(), clang::Type::getAs(), clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsIntegral(), clang::TemplateArgument::getAsTemplate(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateArgument::getAsType(), clang::ASTRecordLayout::getBaseClassOffset(), clang::CXXMethodDecl::getCanonicalDecl(), clang::Decl::getDeclContext(), clang::QualType::getDesugaredType(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getKind(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::NamedDecl::getNameAsString(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getPackAsArray(), clang::TemplateParameterList::getParam(), clang::TemplateArgument::getParamTypeForDecl(), clang::CXXMethodDecl::getParent(), clang::ASTRecordLayout::getPrimaryBase(), clang::NamedDecl::getQualifiedNameAsString(), clang::CXXMethodDecl::getRefQualifier(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::FunctionTemplateSpecializationInfo::getTemplate(), clang::ClassTemplateSpecializationDecl::getTemplateArgs(), clang::FunctionDecl::getTemplatedKind(), clang::TemplateDecl::getTemplateParameters(), clang::FunctionDecl::getTemplateSpecializationArgs(), clang::FunctionDecl::getTemplateSpecializationInfo(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::Decl::hasAttr(), clang::ASTRecordLayout::hasExtendableVFPtr(), clang::FunctionDecl::hasPrototype(), clang::MethodVFTableLocation::Index, clang::Initializer, clang::TemplateArgument::Integral, clang::ASTContext::IntTy, clang::CXXRecordDecl::isDynamicClass(), clang::Expr::isGLValue(), clang::Decl::isImplicit(), clang::CXXMethodDecl::isInstance(), clang::FunctionDecl::isPure(), clang::CXXMethodDecl::isStatic(), clang::CXXMethodDecl::isVirtual(), clang::NoStub, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::NamedDecl::printQualifiedName(), clang::printTemplateArgumentList(), clang::RQ_LValue, clang::RQ_RValue, clang::CXXMethodDecl::size_overridden_methods(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, clang::FunctionDecl::TK_FunctionTemplateSpecialization, clang::TemplateArgument::Type, V, clang::CXXRecordDecl::vbases(), clang::ASTContext::VoidPtrTy, clang::VTableLayout::vtable_components(), and clang::CharUnits::Zero().

◆ needsTypeIdentifier()

static bool needsTypeIdentifier ( const TagDecl TD,
CodeGenModule CGM,
llvm::DICompileUnit *  TheCU 
)
static

◆ shouldOmitDefinition()

static bool shouldOmitDefinition ( codegenoptions::DebugInfoKind  DebugKind,
bool  DebugTypeExtRefs,
const RecordDecl RD,
const LangOptions LangOpts 
)
static

◆ UnwrapTypeForDebugInfo()

static QualType UnwrapTypeForDebugInfo ( QualType  T,
const ASTContext C 
)
static