aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorHarald van Dijk <harald.vandijk@codeplay.com>2025-02-12 17:50:39 +0000
committerHarald van Dijk <harald.vandijk@codeplay.com>2025-02-12 17:50:39 +0000
commit23209eb1d9df57ca3419f5abc6b2edcdc0d1dead (patch)
tree1ded1a640376a5bd69c069755de5365534129a82 /llvm/lib/IR/DebugInfo.cpp
parent3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6 (diff)
downloadllvm-23209eb1d9df57ca3419f5abc6b2edcdc0d1dead.zip
llvm-23209eb1d9df57ca3419f5abc6b2edcdc0d1dead.tar.gz
llvm-23209eb1d9df57ca3419f5abc6b2edcdc0d1dead.tar.bz2
Revert "[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)"
This reverts commit 3ec9f7494b31f2fe51d5ed0e07adcf4b7199def6.
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp41
1 files changed, 16 insertions, 25 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 67c43c1..ea1d79d 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -1690,8 +1690,7 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore(
DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare(
unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
- Instr ? InsertPosition(unwrap<Instruction>(Instr)->getIterator())
- : nullptr);
+ unwrap<Instruction>(Instr));
// This assert will fail if the module is in the old debug info format.
// This function should only be called if the module is in the new
// debug info format.
@@ -1707,8 +1706,7 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd(
LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMBasicBlockRef Block) {
DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare(
unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
- unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
- Block ? InsertPosition(unwrap(Block)->end()) : nullptr);
+ unwrap<DIExpression>(Expr), unwrap<DILocation>(DL), unwrap(Block));
// This assert will fail if the module is in the old debug info format.
// This function should only be called if the module is in the new
// debug info format.
@@ -1724,9 +1722,7 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordBefore(
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr) {
DbgInstPtr DbgInst = unwrap(Builder)->insertDbgValueIntrinsic(
unwrap(Val), unwrap<DILocalVariable>(VarInfo), unwrap<DIExpression>(Expr),
- unwrap<DILocation>(DebugLoc),
- Instr ? InsertPosition(unwrap<Instruction>(Instr)->getIterator())
- : nullptr);
+ unwrap<DILocation>(DebugLoc), unwrap<Instruction>(Instr));
// This assert will fail if the module is in the old debug info format.
// This function should only be called if the module is in the new
// debug info format.
@@ -1742,8 +1738,7 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordAtEnd(
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block) {
DbgInstPtr DbgInst = unwrap(Builder)->insertDbgValueIntrinsic(
unwrap(Val), unwrap<DILocalVariable>(VarInfo), unwrap<DIExpression>(Expr),
- unwrap<DILocation>(DebugLoc),
- Block ? InsertPosition(unwrap(Block)->end()) : nullptr);
+ unwrap<DILocation>(DebugLoc), unwrap(Block));
// This assert will fail if the module is in the old debug info format.
// This function should only be called if the module is in the new
// debug info format.
@@ -1814,19 +1809,16 @@ LLVMMetadataRef LLVMDIBuilderCreateLabel(
LLVMMetadataRef Context, const char *Name, size_t NameLen,
LLVMMetadataRef File, unsigned LineNo, LLVMBool AlwaysPreserve) {
return wrap(unwrap(Builder)->createLabel(
- unwrapDI<DIScope>(Context), StringRef(Name, NameLen),
- unwrapDI<DIFile>(File), LineNo, AlwaysPreserve));
+ unwrapDI<DIScope>(Context), StringRef(Name, NameLen),
+ unwrapDI<DIFile>(File), LineNo, AlwaysPreserve));
}
-LLVMDbgRecordRef LLVMDIBuilderInsertLabelBefore(LLVMDIBuilderRef Builder,
- LLVMMetadataRef LabelInfo,
- LLVMMetadataRef Location,
- LLVMValueRef InsertBefore) {
+LLVMDbgRecordRef LLVMDIBuilderInsertLabelBefore(
+ LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo,
+ LLVMMetadataRef Location, LLVMValueRef InsertBefore) {
DbgInstPtr DbgInst = unwrap(Builder)->insertLabel(
- unwrapDI<DILabel>(LabelInfo), unwrapDI<DILocation>(Location),
- InsertBefore
- ? InsertPosition(unwrap<Instruction>(InsertBefore)->getIterator())
- : nullptr);
+ unwrapDI<DILabel>(LabelInfo), unwrapDI<DILocation>(Location),
+ unwrap<Instruction>(InsertBefore));
// This assert will fail if the module is in the old debug info format.
// This function should only be called if the module is in the new
// debug info format.
@@ -1837,13 +1829,12 @@ LLVMDbgRecordRef LLVMDIBuilderInsertLabelBefore(LLVMDIBuilderRef Builder,
return wrap(cast<DbgRecord *>(DbgInst));
}
-LLVMDbgRecordRef LLVMDIBuilderInsertLabelAtEnd(LLVMDIBuilderRef Builder,
- LLVMMetadataRef LabelInfo,
- LLVMMetadataRef Location,
- LLVMBasicBlockRef InsertAtEnd) {
+LLVMDbgRecordRef LLVMDIBuilderInsertLabelAtEnd(
+ LLVMDIBuilderRef Builder, LLVMMetadataRef LabelInfo,
+ LLVMMetadataRef Location, LLVMBasicBlockRef InsertAtEnd) {
DbgInstPtr DbgInst = unwrap(Builder)->insertLabel(
- unwrapDI<DILabel>(LabelInfo), unwrapDI<DILocation>(Location),
- InsertAtEnd ? InsertPosition(unwrap(InsertAtEnd)->end()) : nullptr);
+ unwrapDI<DILabel>(LabelInfo), unwrapDI<DILocation>(Location),
+ unwrap(InsertAtEnd));
// This assert will fail if the module is in the old debug info format.
// This function should only be called if the module is in the new
// debug info format.