aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-06-09 19:36:34 +0100
committerGitHub <noreply@github.com>2025-06-09 19:36:34 +0100
commit0e4b8b8f81c97ef7374c321fd67a804dd17b4532 (patch)
tree7f20a6ac7323696961b9c94775d5f1a69c9f454e /llvm/lib/Transforms/Utils/Local.cpp
parent7f08503a3bf3acdd2a58ac712d5e95682ce583dd (diff)
downloadllvm-0e4b8b8f81c97ef7374c321fd67a804dd17b4532.zip
llvm-0e4b8b8f81c97ef7374c321fd67a804dd17b4532.tar.gz
llvm-0e4b8b8f81c97ef7374c321fd67a804dd17b4532.tar.bz2
[DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag (#143207)
Start removing debug intrinsics support -- starting with the flag that controls production of their replacement, debug records. This patch removes the command-line-flag and with it the ability to switch back to intrinsics. The module / function / block level "IsNewDbgInfoFormat" flags get hardcoded to true, I'll to incrementally remove things that depend on those flags.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index be71cb6..c8ad01a 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -88,8 +88,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-extern cl::opt<bool> UseNewDbgInfoFormat;
-
#define DEBUG_TYPE "local"
STATISTIC(NumRemoved, "Number of unreachable basic blocks removed");
@@ -1691,16 +1689,10 @@ static void insertDbgValueOrDbgVariableRecord(DIBuilder &Builder, Value *DV,
DIExpression *DIExpr,
const DebugLoc &NewLoc,
BasicBlock::iterator Instr) {
- if (!UseNewDbgInfoFormat) {
- Builder.insertDbgValueIntrinsic(DV, DIVar, DIExpr, NewLoc, Instr);
- } else {
- // RemoveDIs: if we're using the new debug-info format, allocate a
- // DbgVariableRecord directly instead of a dbg.value intrinsic.
- ValueAsMetadata *DVAM = ValueAsMetadata::get(DV);
- DbgVariableRecord *DV =
- new DbgVariableRecord(DVAM, DIVar, DIExpr, NewLoc.get());
- Instr->getParent()->insertDbgRecordBefore(DV, Instr);
- }
+ ValueAsMetadata *DVAM = ValueAsMetadata::get(DV);
+ DbgVariableRecord *DVRec =
+ new DbgVariableRecord(DVAM, DIVar, DIExpr, NewLoc.get());
+ Instr->getParent()->insertDbgRecordBefore(DVRec, Instr);
}
static void insertDbgValueOrDbgVariableRecordAfter(
@@ -1838,7 +1830,6 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableRecord *DVR,
// then we want to insert a dbg.value for the corresponding fragment.
LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: " << *DVR
<< '\n');
- assert(UseNewDbgInfoFormat);
// For now, when there is a store to parts of the variable (but we do not
// know which part) we insert an dbg.value intrinsic to indicate that we
@@ -1919,7 +1910,6 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableRecord *DVR, LoadInst *LI,
// future if multi-location support is added to the IR, it might be
// preferable to keep tracking both the loaded value and the original
// address in case the alloca can not be elided.
- assert(UseNewDbgInfoFormat);
// Create a DbgVariableRecord directly and insert.
ValueAsMetadata *LIVAM = ValueAsMetadata::get(LI);