diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2024-02-20 16:13:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 16:13:28 +0000 |
commit | 3e76e6083da3717fafbb2345eb8a5d1bdac3013e (patch) | |
tree | 7bee8d0a33a09970a26b1d06dba1e0cb7ccf471c /llvm/lib/IR/Function.cpp | |
parent | ababa964752d5bfa6eb608c97f19d4e68df1d243 (diff) | |
download | llvm-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.cpp | 4 |
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. |