aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Debugify.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-06-30 08:01:55 +0100
committerGitHub <noreply@github.com>2025-06-30 08:01:55 +0100
commit140e1894f245896752d06a7f5c405a465b492e73 (patch)
treec822251b6651cca627b73698e566ae516ff3e33d /llvm/lib/Transforms/Utils/Debugify.cpp
parent629126ed44bd3ce5b6f476459c805be4e4e0c2ca (diff)
downloadllvm-140e1894f245896752d06a7f5c405a465b492e73.zip
llvm-140e1894f245896752d06a7f5c405a465b492e73.tar.gz
llvm-140e1894f245896752d06a7f5c405a465b492e73.tar.bz2
[KeyInstr] Add DISubprogram::keyInstructions bit (#144107)
Patch 1/4 adding bitcode support. Store whether or not a function is using Key Instructions in its DISubprogram so that we don't need to rely on the -mllvm flag -dwarf-use-key-instructions to determine whether or not to interpret Key Instructions metadata to decide is_stmt placement at DWARF emission time. This makes bitcode support simple and enables well defined mixing of non-key-instructions and key-instructions functions in an LTO context. This patch adds the bit (using DISubprogram::SubclassData1). PR 144104 and 144103 use it during DWARF emission. PR 44102 adds bitcode support. See pull request for overview of alternative attempts.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Debugify.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index c2dbdc5..5f70bc4 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -123,7 +123,9 @@ bool llvm::applyDebugifyMetadata(
if (F.hasPrivateLinkage() || F.hasInternalLinkage())
SPFlags |= DISubprogram::SPFlagLocalToUnit;
auto SP = DIB.createFunction(CU, F.getName(), F.getName(), File, NextLine,
- SPType, NextLine, DINode::FlagZero, SPFlags);
+ SPType, NextLine, DINode::FlagZero, SPFlags,
+ nullptr, nullptr, nullptr, nullptr, "",
+ /*UseKeyInstructions*/ ApplyAtomGroups);
F.setSubprogram(SP);
// Helper that inserts a dbg.value before \p InsertBefore, copying the