aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2021-02-12 14:28:22 +0700
committerIgor Kudrin <ikudrin@accesssoftek.com>2021-02-17 17:03:34 +0700
commitaa842896299b014dc1837f1a01dfccbd94242c84 (patch)
tree8c347838e485a9c3bcee3d89e380e5a28f83af6c /llvm/lib/IR/Module.cpp
parent7b83837af6f472e9c0ed0b96b78717d4a3c4dbfe (diff)
downloadllvm-aa842896299b014dc1837f1a01dfccbd94242c84.zip
llvm-aa842896299b014dc1837f1a01dfccbd94242c84.tar.gz
llvm-aa842896299b014dc1837f1a01dfccbd94242c84.tar.bz2
[DebugInfo] Keep the DWARF64 flag in the module metadata
This allows the option to affect the LTO output. Module::Max helps to generate debug info for all modules in the same format. Differential Revision: https://reviews.llvm.org/D96597
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index b4f10e2..9395b2b 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -509,6 +509,11 @@ unsigned Module::getDwarfVersion() const {
return cast<ConstantInt>(Val->getValue())->getZExtValue();
}
+bool Module::isDwarf64() const {
+ auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("DWARF64"));
+ return Val && cast<ConstantInt>(Val->getValue())->isOne();
+}
+
unsigned Module::getCodeViewFlag() const {
auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("CodeView"));
if (!Val)