Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/IR/DebugInfoMetadata.cpp
Show First 20 Lines • Show All 795 Lines • ▼ Show 20 Lines | DISubroutineType *DISubroutineType::getImpl(LLVMContext &Context, DIFlags Flags, | ||||
StorageType Storage, | StorageType Storage, | ||||
bool ShouldCreate) { | bool ShouldCreate) { | ||||
DEFINE_GETIMPL_LOOKUP(DISubroutineType, (Flags, CC, TypeArray)); | DEFINE_GETIMPL_LOOKUP(DISubroutineType, (Flags, CC, TypeArray)); | ||||
Metadata *Ops[] = {nullptr, nullptr, nullptr, TypeArray}; | Metadata *Ops[] = {nullptr, nullptr, nullptr, TypeArray}; | ||||
DEFINE_GETIMPL_STORE(DISubroutineType, (Flags, CC), Ops); | DEFINE_GETIMPL_STORE(DISubroutineType, (Flags, CC), Ops); | ||||
} | } | ||||
DIFile::DIFile(LLVMContext &C, StorageType Storage, | DIFile::DIFile(LLVMContext &C, StorageType Storage, | ||||
std::optional<ChecksumInfo<MDString *>> CS, | std::optional<ChecksumInfo<MDString *>> CS, MDString *Src, | ||||
std::optional<MDString *> Src, ArrayRef<Metadata *> Ops) | ArrayRef<Metadata *> Ops) | ||||
: DIScope(C, DIFileKind, Storage, dwarf::DW_TAG_file_type, Ops), | : DIScope(C, DIFileKind, Storage, dwarf::DW_TAG_file_type, Ops), | ||||
Checksum(CS), Source(Src) {} | Checksum(CS), Source(Src) {} | ||||
// FIXME: Implement this string-enum correspondence with a .def file and macros, | // FIXME: Implement this string-enum correspondence with a .def file and macros, | ||||
// so that the association is explicit rather than implied. | // so that the association is explicit rather than implied. | ||||
static const char *ChecksumKindName[DIFile::CSK_Last] = { | static const char *ChecksumKindName[DIFile::CSK_Last] = { | ||||
"CSK_MD5", | "CSK_MD5", | ||||
"CSK_SHA1", | "CSK_SHA1", | ||||
Show All 15 Lines | return StringSwitch<std::optional<DIFile::ChecksumKind>>(CSKindStr) | ||||
.Case("CSK_SHA1", DIFile::CSK_SHA1) | .Case("CSK_SHA1", DIFile::CSK_SHA1) | ||||
.Case("CSK_SHA256", DIFile::CSK_SHA256) | .Case("CSK_SHA256", DIFile::CSK_SHA256) | ||||
.Default(std::nullopt); | .Default(std::nullopt); | ||||
} | } | ||||
DIFile *DIFile::getImpl(LLVMContext &Context, MDString *Filename, | DIFile *DIFile::getImpl(LLVMContext &Context, MDString *Filename, | ||||
MDString *Directory, | MDString *Directory, | ||||
std::optional<DIFile::ChecksumInfo<MDString *>> CS, | std::optional<DIFile::ChecksumInfo<MDString *>> CS, | ||||
std::optional<MDString *> Source, StorageType Storage, | MDString *Source, StorageType Storage, | ||||
bool ShouldCreate) { | bool ShouldCreate) { | ||||
assert(isCanonical(Filename) && "Expected canonical MDString"); | assert(isCanonical(Filename) && "Expected canonical MDString"); | ||||
assert(isCanonical(Directory) && "Expected canonical MDString"); | assert(isCanonical(Directory) && "Expected canonical MDString"); | ||||
assert((!CS || isCanonical(CS->Value)) && "Expected canonical MDString"); | assert((!CS || isCanonical(CS->Value)) && "Expected canonical MDString"); | ||||
assert((!Source || isCanonical(*Source)) && "Expected canonical MDString"); | // We do *NOT* expect Source to be a canonical MDString because nullptr | ||||
// means none, so we need something to represent the empty file. | |||||
DEFINE_GETIMPL_LOOKUP(DIFile, (Filename, Directory, CS, Source)); | DEFINE_GETIMPL_LOOKUP(DIFile, (Filename, Directory, CS, Source)); | ||||
Metadata *Ops[] = {Filename, Directory, CS ? CS->Value : nullptr, | Metadata *Ops[] = {Filename, Directory, CS ? CS->Value : nullptr, Source}; | ||||
Source.value_or(nullptr)}; | |||||
DEFINE_GETIMPL_STORE(DIFile, (CS, Source), Ops); | DEFINE_GETIMPL_STORE(DIFile, (CS, Source), Ops); | ||||
} | } | ||||
DICompileUnit::DICompileUnit(LLVMContext &C, StorageType Storage, | DICompileUnit::DICompileUnit(LLVMContext &C, StorageType Storage, | ||||
unsigned SourceLanguage, bool IsOptimized, | unsigned SourceLanguage, bool IsOptimized, | ||||
unsigned RuntimeVersion, unsigned EmissionKind, | unsigned RuntimeVersion, unsigned EmissionKind, | ||||
uint64_t DWOId, bool SplitDebugInlining, | uint64_t DWOId, bool SplitDebugInlining, | ||||
bool DebugInfoForProfiling, unsigned NameTableKind, | bool DebugInfoForProfiling, unsigned NameTableKind, | ||||
bool RangesBaseAddress, ArrayRef<Metadata *> Ops) | bool RangesBaseAddress, ArrayRef<Metadata *> Ops) | ||||
▲ Show 20 Lines • Show All 1,052 Lines • Show Last 20 Lines |