diff options
author | Anton Sidorenko <anton.sidorenko@syntacore.com> | 2022-11-21 15:26:27 +0300 |
---|---|---|
committer | Anton Sidorenko <anton.sidorenko@syntacore.com> | 2022-11-24 12:20:21 +0300 |
commit | 9ee8d2e081d2622b31e57154458b0317e437d98f (patch) | |
tree | 0edac9af8fabc9c54a53b2e06c46be5f8f5e4a3e /llvm/lib/Transforms/Utils/Debugify.cpp | |
parent | 782196409a4925dc855358e2d80635e43160e8ad (diff) | |
download | llvm-9ee8d2e081d2622b31e57154458b0317e437d98f.zip llvm-9ee8d2e081d2622b31e57154458b0317e437d98f.tar.gz llvm-9ee8d2e081d2622b31e57154458b0317e437d98f.tar.bz2 |
[Debugify] Strip llvm.mir.debugify metadata
We don't strip llvm.mir.debugify metadata in `llvm::stripDebugifyMetadata`. This
may lead to incorrect number of lines and variables in the metadata when we run
debugify twice, e.g. -run-pass=mir-debugify,...,mir-strip-debug,...,mir-debugify.
Differential Revision: https://reviews.llvm.org/D138417
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Debugify.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp index f17d252..74ead37 100644 --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/llvm/lib/Transforms/Utils/Debugify.cpp @@ -243,13 +243,18 @@ applyDebugify(Module &M, bool llvm::stripDebugifyMetadata(Module &M) { bool Changed = false; - // Remove the llvm.debugify module-level named metadata. + // Remove the llvm.debugify and llvm.mir.debugify module-level named metadata. NamedMDNode *DebugifyMD = M.getNamedMetadata("llvm.debugify"); if (DebugifyMD) { M.eraseNamedMetadata(DebugifyMD); Changed = true; } + if (auto *MIRDebugifyMD = M.getNamedMetadata("llvm.mir.debugify")) { + M.eraseNamedMetadata(MIRDebugifyMD); + Changed = true; + } + // Strip out all debug intrinsics and supporting metadata (subprograms, types, // variables, etc). Changed |= StripDebugInfo(M); |