mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Fix bug 19437 - Only add discriminators for DWARF 4 and above.
Summary: This prevents the discriminator generation pass from triggering if the DWARF version being used in the module is prior to 4. Reviewers: echristo, dblaikie CC: llvm-commits Differential Revision: http://reviews.llvm.org/D3413 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -168,14 +168,6 @@ DIType DbgVariable::getType() const {
|
||||
|
||||
} // end llvm namespace
|
||||
|
||||
/// Return Dwarf Version by checking module flags.
|
||||
static unsigned getDwarfVersionFromModule(const Module *M) {
|
||||
Value *Val = M->getModuleFlag("Dwarf Version");
|
||||
if (!Val)
|
||||
return dwarf::DWARF_VERSION;
|
||||
return cast<ConstantInt>(Val)->getZExtValue();
|
||||
}
|
||||
|
||||
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
||||
: Asm(A), MMI(Asm->MMI), FirstCU(0), PrevLabel(NULL), GlobalRangeCount(0),
|
||||
InfoHolder(A, "info_string", DIEValueAllocator),
|
||||
@ -211,7 +203,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
||||
|
||||
DwarfVersion = DwarfVersionNumber
|
||||
? DwarfVersionNumber
|
||||
: getDwarfVersionFromModule(MMI->getModule());
|
||||
: MMI->getModule()->getDwarfVersion();
|
||||
|
||||
{
|
||||
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
|
||||
|
Reference in New Issue
Block a user