summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-09-04 01:38:30 +0000
committerEric Christopher <echristo@gmail.com>2013-09-04 01:38:30 +0000
commit38f1c64098f09da5169ec3ed35b2f13796cbf732 (patch)
treee9a4c88d68e34ac41f5060c55a629b2122a335ab /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parentdc74af1ab8fb0897c7ac2571070130f90462005f (diff)
downloadbcm5719-llvm-38f1c64098f09da5169ec3ed35b2f13796cbf732.tar.gz
bcm5719-llvm-38f1c64098f09da5169ec3ed35b2f13796cbf732.zip
Make the default dwarf version 3 for darwin when we can't find one
in the module. Add a FIXME with a comment about darwin's ld. llvm-svn: 189902
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index b1a75fba6ca..ce684ffe80a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -174,8 +174,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();
}
OpenPOWER on IntegriCloud