mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 23:25:06 +00:00
Add getModuleFlag(StringRef Key) to query a module flag given Key.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186470 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -164,17 +164,10 @@ DIType DbgVariable::getType() const {
|
||||
|
||||
/// Return Dwarf Version by checking module flags.
|
||||
static unsigned getDwarfVersionFromModule(const Module *M) {
|
||||
SmallVector<Module::ModuleFlagEntry, 8> ModuleFlags;
|
||||
M->getModuleFlagsMetadata(ModuleFlags);
|
||||
for (unsigned I = 0, E = ModuleFlags.size(); I < E; ++I) {
|
||||
const Module::ModuleFlagEntry &MFE = ModuleFlags[I];
|
||||
StringRef Key = MFE.Key->getString();
|
||||
Value *Val = MFE.Val;
|
||||
|
||||
if (Key == "Dwarf Version")
|
||||
return cast<ConstantInt>(Val)->getZExtValue();
|
||||
}
|
||||
return dwarf::DWARF_VERSION;
|
||||
Value *Val = M->getModuleFlag("Dwarf Version");
|
||||
if (!Val)
|
||||
return dwarf::DWARF_VERSION;
|
||||
return cast<ConstantInt>(Val)->getZExtValue();
|
||||
}
|
||||
|
||||
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
||||
|
Reference in New Issue
Block a user