[llvm] r190000 - Revert "Revert r189902 as the workaround shouldn't be necessary anymore."
Eric Christopher
echristo at gmail.com
Wed Sep 4 14:36:52 PDT 2013
Author: echristo
Date: Wed Sep 4 16:36:52 2013
New Revision: 190000
URL: http://llvm.org/viewvc/llvm-project?rev=190000&view=rev
Log:
Revert "Revert r189902 as the workaround shouldn't be necessary anymore."
Needs testcase updates.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=190000&r1=189999&r2=190000&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Sep 4 16:36:52 2013
@@ -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<ConstantInt>(Val)->getZExtValue();
}
More information about the llvm-commits
mailing list