summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
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/IR
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/IR')
-rw-r--r--llvm/lib/IR/Module.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 043f74e12da..82b129777f7 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -458,7 +458,14 @@ void Module::dropAllReferences() {
unsigned Module::getDwarfVersion() const {
auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("Dwarf Version"));
if (!Val)
- return dwarf::DWARF_VERSION;
+ return 0;
+ return cast<ConstantInt>(Val->getValue())->getZExtValue();
+}
+
+unsigned Module::getCodeViewFlag() const {
+ auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("CodeView"));
+ if (!Val)
+ return 0;
return cast<ConstantInt>(Val->getValue())->getZExtValue();
}
OpenPOWER on IntegriCloud