[llvm] [DebugInfo][RemoveDIs] Fix another mismatched debug-info flag (PR #82502)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 08:12:48 PST 2024


https://github.com/jmorse created https://github.com/llvm/llvm-project/pull/82502

Here's another scenario where we can create a Function and insert it into a module without carrying over the debug-info flag. See the discourse thread, it's starting to feel like playing whackamole here isn't going to be helpful.

>From 81ff8314ea711c738065b1b5280ada2231fe97d2 Mon Sep 17 00:00:00 2001
From: Jeremy Morse <jeremy.morse at sony.com>
Date: Wed, 21 Feb 2024 16:09:43 +0000
Subject: [PATCH] [DebugInfo][RemoveDIs] Fix another mismatched debug-info flag

Here's another scenario where we can create a Function and insert it into a
module without carrying over the debug-info flag. See the discourse thread,
it's starting to feel like playing whackamole here isn't going to be
helpful.
---
 llvm/lib/IR/Module.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index eeb90a6cb3c465..c02794f049ef4e 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -153,6 +153,7 @@ FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty,
     if (!New->isIntrinsic())       // Intrinsics get attrs set on construction
       New->setAttributes(AttributeList);
     FunctionList.push_back(New);
+    New->IsNewDbgInfoFormat = IsNewDbgInfoFormat;
     return {Ty, New}; // Return the new prototype.
   }
 



More information about the llvm-commits mailing list