clang
10.0.0svn
|
#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/Analysis/Analyses/ExprMutationAnalyzer.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/Basic/AArch64SVEACLETypes.def"
#include "clang/AST/TypeNodes.inc"
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 | SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: |
#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) |
static void | analyzeParametersModification (ASTContext &Ctx, llvm::DenseMap< const FunctionDecl *, llvm::TrackingMDRef > &SPDefCache, llvm::DenseMap< const ParmVarDecl *, llvm::TrackingMDRef > &ParamCache) |
Analyzes each function parameter to determine whether it is constant throughout the function body. More... | |
#define ABSTRACT_TYPE | ( | Class, | |
Base | |||
) |
#define BUILTIN_TYPE | ( | Id, | |
SingletonId | |||
) |
#define DEPENDENT_TYPE | ( | Class, | |
Base | |||
) | case Type::Class: |
#define EXT_OPAQUE_TYPE | ( | ExtType, | |
Id, | |||
Ext | |||
) |
#define IMAGE_TYPE | ( | ImgType, | |
Id, | |||
SingletonId, | |||
Access, | |||
Suffix | |||
) |
#define NON_CANONICAL_TYPE | ( | Class, | |
Base | |||
) |
#define PLACEHOLDER_TYPE | ( | Id, | |
SingletonId | |||
) | case BuiltinType::Id: |
#define SVE_TYPE | ( | Name, | |
Id, | |||
SingletonId | |||
) | case BuiltinType::Id: |
#define TYPE | ( | Class, | |
Base | |||
) |
|
static |
Analyzes each function parameter to determine whether it is constant throughout the function body.
Definition at line 4642 of file CGDebugInfo.cpp.
References clang::FunctionDecl::hasBody(), clang::ExprMutationAnalyzer::isMutated(), and clang::FunctionDecl::parameters().
Referenced by clang::CodeGen::CGDebugInfo::finalize().
|
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 1220 of file CGDebugInfo.cpp.
References clang::AS_none, clang::AS_private, clang::AS_protected, clang::AS_public, clang::Default, clang::TagDecl::isClass(), clang::TagDecl::isStruct(), and clang::TagDecl::isUnion().
Referenced by isFunctionLocalClass().
|
static |
Definition at line 61 of file CGDebugInfo.cpp.
References clang::Decl::getMaxAlignment(), and clang::Decl::hasAttr().
Referenced by clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), and hasDefaultSetterName().
|
static |
Definition at line 1151 of file CGDebugInfo.cpp.
References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64VectorCall, clang::CC_C, clang::CC_IntelOclBicc, clang::CC_OpenCLKernel, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_SpirFunction, clang::CC_Swift, clang::CC_Win64, clang::CC_X86_64SysV, clang::CC_X86FastCall, clang::CC_X86Pascal, clang::CC_X86RegCall, clang::CC_X86StdCall, clang::CC_X86ThisCall, clang::CC_X86VectorCall, clang::FunctionType::getCallConv(), and clang::FunctionType::getReturnType().
|
static |
Definition at line 957 of file CGDebugInfo.cpp.
References clang::RecordType::getDecl(), clang::Decl::getLocation(), getTypeAlignIfRequired(), getTypeIdentifier(), Identifier, clang::TagDecl::isClass(), clang::TagDecl::isInterface(), clang::TagDecl::isStruct(), clang::TagDecl::isUnion(), and Line.
Referenced by clang::CodeGen::CGDebugInfo::completeUnusedClass().
|
static |
Definition at line 52 of file CGDebugInfo.cpp.
References clang::TypeInfo::AlignIsRequired, and clang::ASTContext::getTypeInfo().
Referenced by getTagForRecord(), getTypeAlignIfRequired(), and hasDefaultSetterName().
|
static |
Definition at line 57 of file CGDebugInfo.cpp.
References getTypeAlignIfRequired(), and clang::QualType::getTypePtr().
|
static |
Definition at line 936 of file CGDebugInfo.cpp.
References clang::ExternalLinkage, clang::CodeGen::CodeGenModule::getCXXABI(), clang::TagType::getDecl(), clang::RecordDecl::getDefinition(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::CodeGen::CodeGenModule::getVTableLinkage(), Identifier, clang::MangleContext::mangleCXXRTTIName(), and needsTypeIdentifier().
Referenced by clang::CodeGen::CGDebugInfo::completeUnusedClass(), getTagForRecord(), and hasDefaultSetterName().
Definition at line 884 of file CGDebugInfo.cpp.
Referenced by needsTypeIdentifier().
|
static |
Definition at line 2308 of file CGDebugInfo.cpp.
References clang::NamedDecl::getDeclName(), clang::NamedDecl::getName(), clang::Selector::getNameForSlot(), clang::DeclarationName::getObjCSelector(), and clang::DeclarationName::isObjCZeroArgSelector().
Referenced by hasDefaultSetterName().
|
static |
Definition at line 2320 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.
|
static |
Definition at line 2152 of file CGDebugInfo.cpp.
References clang::FunctionDecl::getInstantiatedFromMemberFunction().
Referenced by shouldOmitDefinition().
|
static |
Return true if the class or any of its methods are marked dllimport.
Definition at line 2084 of file CGDebugInfo.cpp.
References clang::Decl::hasAttr(), and clang::CXXRecordDecl::methods().
Referenced by clang::CodeGen::CGDebugInfo::completeClassData(), and shouldOmitDefinition().
|
static |
Does a type definition exist in an imported clang module?
Definition at line 2094 of file CGDebugInfo.cpp.
References clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::DeclContext::getEnclosingNamespaceContext(), clang::NamedDecl::getName(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::TagDecl::isCompleteDefinition(), clang::NamedDecl::isExternallyVisible(), clang::Decl::isFromASTFile(), clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_Undeclared.
Referenced by clang::CodeGen::CGDebugInfo::completeClassData(), and shouldOmitDefinition().
|
static |
isFunctionLocalClass - Return true if CXXRecordDecl is defined inside a function.
Definition at line 1530 of file CGDebugInfo.cpp.
References clang::CXXRecordDecl::bases(), clang::Type::castAs(), clang::DeclContext::decls(), clang::Dtor_Deleting, clang::Decl::getAccess(), getAccessFlag(), clang::ASTRecordLayout::getBaseClassOffset(), clang::CXXMethodDecl::getCanonicalDecl(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::CXXMethodDecl::getRefQualifier(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::FunctionDecl::hasPrototype(), clang::MethodVFTableLocation::Index, clang::Decl::isImplicit(), clang::FunctionDecl::isNoReturn(), clang::FunctionDecl::isPure(), clang::CXXMethodDecl::isStatic(), clang::CXXMethodDecl::isVirtual(), clang::RQ_LValue, clang::RQ_RValue, clang::CXXMethodDecl::size_overridden_methods(), and clang::CXXRecordDecl::vbases().
|
static |
Definition at line 918 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), hasCXXMangling(), and clang::NamedDecl::isExternallyVisible().
Referenced by getTypeIdentifier().
|
static |
Definition at line 2162 of file CGDebugInfo.cpp.
References clang::ExternalASTSource::EK_Always, clang::Decl::getASTContext(), clang::RecordDecl::getDefinition(), clang::ASTContext::getExternalSource(), clang::CXXRecordDecl::hasDefinition(), hasExplicitMemberDefinition(), isClassOrMethodDLLImport(), clang::TagDecl::isCompleteDefinitionRequired(), isDefinedInClangModule(), clang::CXXRecordDecl::isDynamicClass(), clang::codegenoptions::LimitedDebugInfo, clang::CXXRecordDecl::method_begin(), clang::CXXRecordDecl::method_end(), clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_Undeclared.
Referenced by clang::CodeGen::CGDebugInfo::completeRequiredType().
|
static |
Definition at line 2848 of file CGDebugInfo.cpp.
References clang::Auto, clang::QualType::getAsOpaquePtr(), clang::QualType::getLocalQualifiers(), clang::ASTContext::getQualifiedType(), clang::Type::getTypeClass(), clang::QualType::getTypePtr(), getUnderlyingType(), clang::QualType::isNull(), Paren, clang::Qualifiers::removeCommonQualifiers(), and V.
Referenced by clang::CodeGen::CGDebugInfo::completeUnusedClass().