From aa842896299b014dc1837f1a01dfccbd94242c84 Mon Sep 17 00:00:00 2001 From: Igor Kudrin Date: Fri, 12 Feb 2021 14:28:22 +0700 Subject: [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 --- llvm/lib/IR/Module.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/IR/Module.cpp') 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(Val->getValue())->getZExtValue(); } +bool Module::isDwarf64() const { + auto *Val = cast_or_null(getModuleFlag("DWARF64")); + return Val && cast(Val->getValue())->isOne(); +} + unsigned Module::getCodeViewFlag() const { auto *Val = cast_or_null(getModuleFlag("CodeView")); if (!Val) -- cgit v1.1