aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2024-02-20 16:13:28 +0000
committerGitHub <noreply@github.com>2024-02-20 16:13:28 +0000
commit3e76e6083da3717fafbb2345eb8a5d1bdac3013e (patch)
tree7bee8d0a33a09970a26b1d06dba1e0cb7ccf471c /llvm/lib/IR/Function.cpp
parentababa964752d5bfa6eb608c97f19d4e68df1d243 (diff)
downloadllvm-3e76e6083da3717fafbb2345eb8a5d1bdac3013e.zip
llvm-3e76e6083da3717fafbb2345eb8a5d1bdac3013e.tar.gz
llvm-3e76e6083da3717fafbb2345eb8a5d1bdac3013e.tar.bz2
[DebugInfo][RemoveDIs] Set new-dbg-info flag from Modules correctly (#82373)
It turns out there's a pathway for Functions to be inserted into modules without having the "New" debug-info flag set correctly, which this patch fixes. Sadly there isn't a Module::insert method to instrument out there, everyone touches the list directly. This fix exposes a path where such functions are produced in the outliner in the wrong mode; requiring a fix there to correctly drop RemoveDIs-mode debug-info. This is covered by test/DebugInfo/AArch64/ir-outliner.ll
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index fceffbc..056e4f3 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -437,8 +437,10 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace,
if (Ty->getNumParams())
setValueSubclassData(1); // Set the "has lazy arguments" bit.
- if (ParentModule)
+ if (ParentModule) {
ParentModule->getFunctionList().push_back(this);
+ IsNewDbgInfoFormat = ParentModule->IsNewDbgInfoFormat;
+ }
HasLLVMReservedName = getName().starts_with("llvm.");
// Ensure intrinsics have the right parameter attributes.