summaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2024-01-25 14:17:35 +0000
committerJeremy Morse <jeremy.morse@sony.com>2024-01-25 14:18:31 +0000
commitc3f7fb1421e1dbf2fb1d5594bfa801489bdab421 (patch)
tree6119164f478cb72e4a6d7adaa3190b539e04b8da /llvm/lib
parenta04d4a03f7737202b5cd05687e08ed8748ef7352 (diff)
Revert "[DebugInfo][RemoveDIs] Convert debug-info modes when loading bitcode (#78967)"
This reverts commit 215b8f1e252b4f30cf1b734faa370c0ac4b88659. Numerous builders exploded from this X_X, for example https://lab.llvm.org/buildbot/#/builders/46/builds/62657
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp23
-rw-r--r--llvm/lib/IR/LegacyPassManager.cpp6
-rw-r--r--llvm/lib/Linker/IRMover.cpp1
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp8
4 files changed, 4 insertions, 34 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 5b233fb365fe..a027d0c21ba0 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -100,9 +100,6 @@ static cl::opt<bool> ExpandConstantExprs(
cl::desc(
"Expand constant expressions to instructions for testing purposes"));
-// Declare external flag for whether we're using the new debug-info format.
-extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
-
namespace {
enum {
@@ -6632,9 +6629,6 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
if (Error Err = materializeMetadata())
return Err;
- bool NewDebugInfoRequested = F->IsNewDbgInfoFormat;
- F->IsNewDbgInfoFormat = false;
-
// Move the bit stream to the saved position of the deferred function body.
if (Error JumpFailed = Stream.JumpToBit(DFII->second))
return JumpFailed;
@@ -6710,14 +6704,6 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
// Look for functions that rely on old function attribute behavior.
UpgradeFunctionAttributes(*F);
- // If we've materialized a function set up in "new" debug-info mode, the
- // contents just loaded will still be in dbg.value mode. Switch to the new
- // mode now. NB: we can add more complicated logic here in the future to
- // correctly identify when we do and don't need to autoupgrade.
- if (NewDebugInfoRequested) {
- F->convertToNewDbgValues();
- }
-
// Bring in any functions that this function forward-referenced via
// blockaddresses.
return materializeForwardReferencedFunctions();
@@ -8041,15 +8027,6 @@ BitcodeModule::getModuleImpl(LLVMContext &Context, bool MaterializeAll,
if (Error Err = R->materializeForwardReferencedFunctions())
return std::move(Err);
}
-
- // If we are operating in a "new debug-info" context, upgrade the debug-info
- // in the loaded module. This is a transitional approach as we enable "new"
- // debug-info in LLVM, which will eventually be pushed down into the
- // autoupgrade path once the bitcode-encoding is finalised. Non-materialised
- // functions will be upgraded in the materialize method.
- if (UseNewDbgInfoFormat && !M->IsNewDbgInfoFormat)
- M->convertToNewDbgValues();
-
return std::move(M);
}
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index 8945c6dbc8d8..dac4fbce17e4 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -530,8 +530,7 @@ bool PassManagerImpl::run(Module &M) {
// RemoveDIs: if a command line flag is given, convert to the DPValue
// representation of debug-info for the duration of these passes.
- bool shouldConvertDbgInfo = UseNewDbgInfoFormat && !M.IsNewDbgInfoFormat;
- if (shouldConvertDbgInfo)
+ if (UseNewDbgInfoFormat)
M.convertToNewDbgValues();
for (ImmutablePass *ImPass : getImmutablePasses())
@@ -546,8 +545,7 @@ bool PassManagerImpl::run(Module &M) {
for (ImmutablePass *ImPass : getImmutablePasses())
Changed |= ImPass->doFinalization(M);
- if (shouldConvertDbgInfo)
- M.convertFromNewDbgValues();
+ M.convertFromNewDbgValues();
return Changed;
}
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index 8cc0f7fb9099..1bd562d1e8ae 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -694,7 +694,6 @@ Function *IRLinker::copyFunctionProto(const Function *SF) {
SF->getAddressSpace(), SF->getName(), &DstM);
F->copyAttributesFrom(SF);
F->setAttributes(mapAttributeTypes(F->getContext(), F->getAttributes()));
- F->IsNewDbgInfoFormat = SF->IsNewDbgInfoFormat;
return F;
}
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index 6574b3851af3..380541ffdd49 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -1056,13 +1056,9 @@ void Mapper::remapFunction(Function &F) {
A.mutateType(TypeMapper->remapType(A.getType()));
// Remap the instructions.
- for (BasicBlock &BB : F) {
- for (Instruction &I : BB) {
+ for (BasicBlock &BB : F)
+ for (Instruction &I : BB)
remapInstruction(&I);
- for (DPValue &DPV : I.DbgMarker->getDbgValueRange())
- remapDPValue(DPV);
- }
- }
}
void Mapper::mapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix,