From c9f1e785d55cbc47a0ae33a49b8ea2c45b442d2b Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 4 Sep 2013 21:36:52 +0000 Subject: Revert "Revert r189902 as the workaround shouldn't be necessary anymore." Needs testcase updates. llvm-svn: 190000 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 535b094f168..6835f40cd8e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -161,8 +161,12 @@ DIType DbgVariable::getType() const { /// Return Dwarf Version by checking module flags. static unsigned getDwarfVersionFromModule(const Module *M) { Value *Val = M->getModuleFlag("Dwarf Version"); + // If we don't have a value in the module go ahead and use the default in + // dwarf::DWARF_VERSION. + // FIXME: Apple ld has a problem parsing compilation units that specify a + // dwarf version of greater than 3. if (!Val) - return dwarf::DWARF_VERSION; + return Triple(M->getTargetTriple()).isOSDarwin() ? 3 : dwarf::DWARF_VERSION; return cast(Val)->getZExtValue(); } -- cgit v1.2.3