[PATCH] D127102: [CloneFunction][DebugInfo] Avoid cloning DILexicalBlocks of inlined subprograms

Kristina Bessonova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 05:15:05 PDT 2022


krisb created this revision.
krisb added reviewers: dexonsmith, aprantl, jdoerfert.
Herald added a subscriber: hiraditya.
Herald added a project: All.
krisb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If DISubpogram was not cloned (e.g. we are cloning a function that has other
functions inlined into it, and subprograms of the inlined functions are
not supposed to be cloned), it doesn't make sense to clone its DILexicalBlocks
as well. Otherwise we'll get duplicated DILexicalBlocks that may confuse
debug info emission in AsmPrinter.

I believe it also makes no sense cloning any DILocalVariables or maybe
other local entities, if their parent subprogram was not cloned, cause
they will be dangling and will not participate in futher emission.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127102

Files:
  llvm/lib/Transforms/Utils/CloneFunction.cpp
  llvm/test/Transforms/Coroutines/coro-debug-frame-variable.ll
  llvm/unittests/Transforms/Utils/CloningTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127102.434438.patch
Type: text/x-patch
Size: 6074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220606/29883597/attachment.bin>


More information about the llvm-commits mailing list