summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2018-10-31 17:18:41 +0000
committerMatthias Braun <matze@braunis.de>2018-10-31 17:18:41 +0000
commit8763c0c5b7a566d2fe9476259aa346640b0a9deb (patch)
tree8cc20cf0da6a2e1c5c0e0fc324523902b1ff7c7f /llvm/lib/CodeGen/MachineModuleInfo.cpp
parentc1db1d8975f309fba4eb66db5908a241ffae84b9 (diff)
downloadbcm5719-llvm-8763c0c5b7a566d2fe9476259aa346640b0a9deb.tar.gz
bcm5719-llvm-8763c0c5b7a566d2fe9476259aa346640b0a9deb.zip
MachineModuleInfo: Initialize DbgInfoAvailable depending on debug_cus existing
Before this patch DbgInfoAvailable was set to true in DwarfDebug::beginModule() or CodeViewDebug::CodeViewDebug(). This made MIR testing weird since passes would suddenly stop dealing with debug info just because we stopped the pipeline before the debug printers. This patch changes the logic to initialize DbgInfoAvailable based on the fact that debug_compile_units exist in the llvm Module. The debug printers may then override it with false in case of debug printing being disabled. Differential Revision: https://reviews.llvm.org/D53885 llvm-svn: 345740
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index 639cd80768f..ce556903dc0 100644
--- a/llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -206,10 +206,11 @@ MachineModuleInfo::~MachineModuleInfo() = default;
bool MachineModuleInfo::doInitialization(Module &M) {
ObjFileMMI = nullptr;
CurCallSite = 0;
- DbgInfoAvailable = UsesVAFloatArgument = UsesMorestackAddr = false;
+ UsesVAFloatArgument = UsesMorestackAddr = false;
HasSplitStack = HasNosplitStack = false;
AddrLabelSymbols = nullptr;
TheModule = &M;
+ DbgInfoAvailable = !empty(M.debug_compile_units());
return false;
}
OpenPOWER on IntegriCloud