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

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 12:05:28 PST 2024


Author: Matt Arsenault
Date: 2024-11-04T12:05:25-08:00
New Revision: 6c3704da420357300c4b228c815f41da27b3158d

URL: https://github.com/llvm/llvm-project/commit/6c3704da420357300c4b228c815f41da27b3158d
DIFF: https://github.com/llvm/llvm-project/commit/6c3704da420357300c4b228c815f41da27b3158d.diff

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

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/StripSymbols.cpp

Removed: 
    


################################################################################
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