summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-08-05 22:26:20 +0000
committerReid Kleckner <rnk@google.com>2015-08-05 22:26:20 +0000
commit12d2c12023f8ad582abf6c60013c81b7239124c4 (patch)
treebdebc2c88366d695c0c24e613734b263b49390da /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent5672a893e536a3865d9592cc2f21e8e608af52ac (diff)
downloadbcm5719-llvm-12d2c12023f8ad582abf6c60013c81b7239124c4.tar.gz
bcm5719-llvm-12d2c12023f8ad582abf6c60013c81b7239124c4.zip
If the "CodeView" module flag is set, emit codeview instead of DWARF
Summary: Emit both DWARF and CodeView if "CodeView" and "Dwarf Version" module flags are set. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11756 llvm-svn: 244158
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a2dc8c839c7..e731542d419 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -252,6 +252,8 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
unsigned DwarfVersionNumber = Asm->TM.Options.MCOptions.DwarfVersion;
DwarfVersion = DwarfVersionNumber ? DwarfVersionNumber
: MMI->getModule()->getDwarfVersion();
+ // Use dwarf 4 by default if nothing is requested.
+ DwarfVersion = DwarfVersion ? DwarfVersion : dwarf::DWARF_VERSION;
// Work around a GDB bug. GDB doesn't support the standard opcode;
// SCE doesn't support GNU's; LLDB prefers the standard opcode, which
OpenPOWER on IntegriCloud