aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorCarlos Alberto Enciso <Carlos.Enciso@sony.com>2024-06-18 08:39:36 +0100
committerGitHub <noreply@github.com>2024-06-18 08:39:36 +0100
commitdb394edf95e7e47e2a11c570d65a8f5005af7849 (patch)
treed443eb84b880e54a1944e706b2a9f6bbbb940c97 /llvm/lib/IR/DebugInfo.cpp
parent3ca17443ef4af21bdb1f3b4fbcfff672cbc6176c (diff)
downloadllvm-db394edf95e7e47e2a11c570d65a8f5005af7849.zip
llvm-db394edf95e7e47e2a11c570d65a8f5005af7849.tar.gz
llvm-db394edf95e7e47e2a11c570d65a8f5005af7849.tar.bz2
[RemoveDIs] Update DIBuilder C API with DbgRecord functions. (#95535)
The DIBuilder C API was changed to deal with DbgRecord functions: https://github.com/llvm/llvm-project/pull/84915 https://github.com/llvm/llvm-project/pull/85657 https://github.com/llvm/llvm-project/pull/92417#issuecomment-2120078326 As discussed by @nikic and @OCHyams: https://github.com/llvm/llvm-project/pull/92417#issuecomment-2144505440 > For the intrinsic-inserting functions, do you think we should: > > a) mark as deprecated but otherwise leave them alone for now. > b) mark as deprecated and change their behaviour so that they > do nothing and return nullptr. > c) outright delete them (it sounds like you're voting this one, > but just wanted to double check). This patch implements option (c).
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp87
1 files changed, 0 insertions, 87 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 228e176..e57c3fe 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -1662,29 +1662,6 @@ LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(
unwrapDI<MDNode>(Decl), nullptr, AlignInBits));
}
-LLVMDbgRecordRef
-LLVMDIBuilderInsertDeclareBefore(LLVMDIBuilderRef Builder, LLVMValueRef Storage,
- LLVMMetadataRef VarInfo, LLVMMetadataRef Expr,
- LLVMMetadataRef DL, LLVMValueRef Instr) {
- return LLVMDIBuilderInsertDeclareRecordBefore(Builder, Storage, VarInfo, Expr,
- DL, Instr);
-}
-LLVMValueRef LLVMDIBuilderInsertDeclareIntrinsicBefore(
- LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
- LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMValueRef Instr) {
- DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare(
- unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
- unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
- unwrap<Instruction>(Instr));
- // This assert will fail if the module is in the new debug info format.
- // This function should only be called if the module is in the old
- // debug info format.
- // See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes,
- // LLVMIsNewDbgInfoFormat, and LLVMSetIsNewDbgInfoFormat for more info.
- assert(isa<Instruction *>(DbgInst) &&
- "Function unexpectedly in new debug info format");
- return wrap(cast<Instruction *>(DbgInst));
-}
LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore(
LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMValueRef Instr) {
@@ -1702,28 +1679,6 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore(
return wrap(cast<DbgRecord *>(DbgInst));
}
-LLVMDbgRecordRef
-LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Builder, LLVMValueRef Storage,
- LLVMMetadataRef VarInfo, LLVMMetadataRef Expr,
- LLVMMetadataRef DL, LLVMBasicBlockRef Block) {
- return LLVMDIBuilderInsertDeclareRecordAtEnd(Builder, Storage, VarInfo, Expr,
- DL, Block);
-}
-LLVMValueRef LLVMDIBuilderInsertDeclareIntrinsicAtEnd(
- LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
- LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMBasicBlockRef Block) {
- DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare(
- unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
- unwrap<DIExpression>(Expr), unwrap<DILocation>(DL), unwrap(Block));
- // This assert will fail if the module is in the new debug info format.
- // This function should only be called if the module is in the old
- // debug info format.
- // See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes,
- // LLVMIsNewDbgInfoFormat, and LLVMSetIsNewDbgInfoFormat for more info.
- assert(isa<Instruction *>(DbgInst) &&
- "Function unexpectedly in new debug info format");
- return wrap(cast<Instruction *>(DbgInst));
-}
LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd(
LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DL, LLVMBasicBlockRef Block) {
@@ -1740,27 +1695,6 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd(
return wrap(cast<DbgRecord *>(DbgInst));
}
-LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueBefore(
- LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
- LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr) {
- return LLVMDIBuilderInsertDbgValueRecordBefore(Builder, Val, VarInfo, Expr,
- DebugLoc, Instr);
-}
-LLVMValueRef LLVMDIBuilderInsertDbgValueIntrinsicBefore(
- LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
- LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr) {
- DbgInstPtr DbgInst = unwrap(Builder)->insertDbgValueIntrinsic(
- unwrap(Val), unwrap<DILocalVariable>(VarInfo), unwrap<DIExpression>(Expr),
- unwrap<DILocation>(DebugLoc), unwrap<Instruction>(Instr));
- // This assert will fail if the module is in the new debug info format.
- // This function should only be called if the module is in the old
- // debug info format.
- // See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes,
- // LLVMIsNewDbgInfoFormat, and LLVMSetIsNewDbgInfoFormat for more info.
- assert(isa<Instruction *>(DbgInst) &&
- "Function unexpectedly in new debug info format");
- return wrap(cast<Instruction *>(DbgInst));
-}
LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordBefore(
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr) {
@@ -1777,27 +1711,6 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordBefore(
return wrap(cast<DbgRecord *>(DbgInst));
}
-LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueAtEnd(
- LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
- LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block) {
- return LLVMDIBuilderInsertDbgValueRecordAtEnd(Builder, Val, VarInfo, Expr,
- DebugLoc, Block);
-}
-LLVMValueRef LLVMDIBuilderInsertDbgValueIntrinsicAtEnd(
- LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
- LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block) {
- DbgInstPtr DbgInst = unwrap(Builder)->insertDbgValueIntrinsic(
- unwrap(Val), unwrap<DILocalVariable>(VarInfo), unwrap<DIExpression>(Expr),
- unwrap<DILocation>(DebugLoc), unwrap(Block));
- // This assert will fail if the module is in the new debug info format.
- // This function should only be called if the module is in the old
- // debug info format.
- // See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes,
- // LLVMIsNewDbgInfoFormat, and LLVMSetIsNewDbgInfoFormat for more info.
- assert(isa<Instruction *>(DbgInst) &&
- "Function unexpectedly in new debug info format");
- return wrap(cast<Instruction *>(DbgInst));
-}
LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordAtEnd(
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo,
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block) {