aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorRahul Joshi <rjoshi@nvidia.com>2024-10-11 05:26:03 -0700
committerGitHub <noreply@github.com>2024-10-11 05:26:03 -0700
commitfa789dffb1e12c2aece0187aeacc48dfb1768340 (patch)
treecebfdc0d8b0111115cbefeb8d2927fe8c2cfbdfb /llvm/lib/IR/DIBuilder.cpp
parent900ea21ffb38ba5b783b20f394c43c6c89d58086 (diff)
downloadllvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.zip
llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.tar.gz
llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.tar.bz2
[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)
Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclaration` that will have behavior similar to `Module::getFunction` (i.e, just lookup, no creation).
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 0db82cd..447a9d6 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -991,7 +991,7 @@ DbgInstPtr DIBuilder::insertDbgAssign(Instruction *LinkedInstr, Value *Val,
LLVMContext &Ctx = LinkedInstr->getContext();
Module *M = LinkedInstr->getModule();
if (!AssignFn)
- AssignFn = Intrinsic::getDeclaration(M, Intrinsic::dbg_assign);
+ AssignFn = Intrinsic::getOrInsertDeclaration(M, Intrinsic::dbg_assign);
std::array<Value *, 6> Args = {
MetadataAsValue::get(Ctx, ValueAsMetadata::get(Val)),
@@ -1060,7 +1060,7 @@ static Value *getDbgIntrinsicValueImpl(LLVMContext &VMContext, Value *V) {
}
static Function *getDeclareIntrin(Module &M) {
- return Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
+ return Intrinsic::getOrInsertDeclaration(&M, Intrinsic::dbg_declare);
}
DbgInstPtr DIBuilder::insertDbgValueIntrinsic(
@@ -1074,7 +1074,7 @@ DbgInstPtr DIBuilder::insertDbgValueIntrinsic(
}
if (!ValueFn)
- ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
+ ValueFn = Intrinsic::getOrInsertDeclaration(&M, Intrinsic::dbg_value);
return insertDbgIntrinsic(ValueFn, Val, VarInfo, Expr, DL, InsertBB,
InsertBefore);
}
@@ -1175,7 +1175,7 @@ DbgInstPtr DIBuilder::insertLabel(DILabel *LabelInfo, const DILocation *DL,
}
if (!LabelFn)
- LabelFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_label);
+ LabelFn = Intrinsic::getOrInsertDeclaration(&M, Intrinsic::dbg_label);
Value *Args[] = {MetadataAsValue::get(VMContext, LabelInfo)};