[llvm] StripSymbols: Query llvm.dbg.declare by intrinsic ID instead of name (PR #114836)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 09:25:46 PST 2024


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/114836

None

>From 858281437c8393b25e2aa9fcf5ff43f46fbf0a66 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Mon, 4 Nov 2024 09:24:14 -0800
Subject: [PATCH] StripSymbols: Query llvm.dbg.declare by intrinsic ID instead
 of name

---
 llvm/lib/Transforms/IPO/StripSymbols.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Transforms/IPO/StripSymbols.cpp b/llvm/lib/Transforms/IPO/StripSymbols.cpp
index 31b8313ece3899..e7b70308ba7aa3 100644
--- a/llvm/lib/Transforms/IPO/StripSymbols.cpp
+++ b/llvm/lib/Transforms/IPO/StripSymbols.cpp
@@ -142,8 +142,8 @@ static bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
 }
 
 static bool stripDebugDeclareImpl(Module &M) {
-
-  Function *Declare = M.getFunction("llvm.dbg.declare");
+  Function *Declare =
+      Intrinsic::getDeclarationIfExists(&M, Intrinsic::dbg_declare);
   std::vector<Constant*> DeadConstants;
 
   if (Declare) {



More information about the llvm-commits mailing list