aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-06-11 14:51:13 +0100
committerJeremy Morse <jeremy.morse@sony.com>2025-06-11 14:52:17 +0100
commit76197ea6f91f802467f2614e1217e99eb4037200 (patch)
tree7398905a7079d66ec996598a4a9ec4043c1d05ec /llvm/lib/IR/DebugInfo.cpp
parent46d9abbba2ad63c0280d4248cc2349de78439294 (diff)
downloadllvm-76197ea6f91f802467f2614e1217e99eb4037200.zip
llvm-76197ea6f91f802467f2614e1217e99eb4037200.tar.gz
llvm-76197ea6f91f802467f2614e1217e99eb4037200.tar.bz2
Revert "[DebugInfo][RemoveDIs] Remove some debug intrinsic-only codepaths (#143451)"
This reverts commit c71a2e688828ab3ede4fb54168a674ff68396f61. /me squints -- this is hitting an assertion I thought had been deleted, will revert and investigate for a bit.
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 2a84e7b..7db9891 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -2123,11 +2123,22 @@ static void emitDbgAssign(AssignmentInfo Info, Value *Val, Value *Dest,
Expr = *R;
}
DIExpression *AddrExpr = DIExpression::get(StoreLikeInst.getContext(), {});
- auto *Assign = DbgVariableRecord::createLinkedDVRAssign(
- &StoreLikeInst, Val, VarRec.Var, Expr, Dest, AddrExpr, VarRec.DL);
+ if (StoreLikeInst.getParent()->IsNewDbgInfoFormat) {
+ auto *Assign = DbgVariableRecord::createLinkedDVRAssign(
+ &StoreLikeInst, Val, VarRec.Var, Expr, Dest, AddrExpr, VarRec.DL);
+ (void)Assign;
+ LLVM_DEBUG(if (Assign) errs() << " > INSERT: " << *Assign << "\n");
+ return;
+ }
+ auto Assign = DIB.insertDbgAssign(&StoreLikeInst, Val, VarRec.Var, Expr, Dest,
+ AddrExpr, VarRec.DL);
(void)Assign;
- LLVM_DEBUG(if (Assign) errs() << " > INSERT: " << *Assign << "\n");
- return;
+ LLVM_DEBUG(if (!Assign.isNull()) {
+ if (const auto *Record = dyn_cast<DbgRecord *>(Assign))
+ errs() << " > INSERT: " << *Record << "\n";
+ else
+ errs() << " > INSERT: " << *cast<Instruction *>(Assign) << "\n";
+ });
}
#undef DEBUG_TYPE // Silence redefinition warning (from ConstantsContext.h).