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

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 09:26:38 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Matt Arsenault (arsenm)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/114836.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/IPO/StripSymbols.cpp (+2-2) 


``````````diff
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) {

``````````

</details>


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


More information about the llvm-commits mailing list