[llvm] [LLVM] Re-add `Intrinsic::getDeclaration` for out-of-tree code (PR #112242)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 11:16:33 PDT 2024


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/112242

Re-add `Intrinsic::getDeclaration` (which was renamed to `getOrInsertDeclaration` in an earlier commit) as a deprecated function. It will be removed in the next LLVM release.

>From 247c23a27450d3648738e52fee4d5ce8b50a4a34 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Mon, 14 Oct 2024 11:13:23 -0700
Subject: [PATCH] [LLVM] Re-add `Intrinsic::getDeclaration` for out-of-tree
 code

Re-add `Intrinsic::getDeclaration` (which was renamed to
`getOrInsertDeclaration` in an earlier commit) as a deprecated
function. It will be removed in the next LLVM release.
---
 llvm/include/llvm/IR/Intrinsics.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h
index 8c37925732a83a..49f4fe4c5c3d7f 100644
--- a/llvm/include/llvm/IR/Intrinsics.h
+++ b/llvm/include/llvm/IR/Intrinsics.h
@@ -97,6 +97,11 @@ namespace Intrinsic {
   /// the intrinsic.
   Function *getOrInsertDeclaration(Module *M, ID id, ArrayRef<Type *> Tys = {});
 
+  LLVM_DEPRECATED("Use getOrInsertDeclaration instead",
+                  "getOrInsertDeclaration")
+  inline Function *getDeclaration(Module *M, ID id, ArrayRef<Type *> Tys = {}) {
+    return getOrInsertDeclaration(M, id, Tys);
+  }
   /// Looks up Name in NameTable via binary search. NameTable must be sorted
   /// and all entries must start with "llvm.".  If NameTable contains an exact
   /// match for Name or a prefix of Name followed by a dot, its index in



More information about the llvm-commits mailing list