[PATCH] D125691: [DebugInfo] Add localDecls field to DISubprogram and DILexicalBlock (1/5)

Kristina Bessonova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 02:45:32 PDT 2022


krisb added a comment.

In D125691#3580147 <https://reviews.llvm.org/D125691#3580147>, @aprantl wrote:

> Do you need to add any special handling to `CloneFunction.cpp` or will it work correctly?

It will work correctly. 
D125693 <https://reviews.llvm.org/D125693> has a test case that checks that a function with 2 local 'global' variables gets properly cloned.

There is a corner case, though. It doesn't directly relate to this patch, but still needs to be mentioned. If to clone a function with other functions inlined into it within the same module, DISubprograms of the inlined functions will not be cloned. But DILexicalBlocks in scopes of such inlined functions will be duplicated which may cause problems later in AsmPrinter. D127102 <https://reviews.llvm.org/D127102> proposes to skip cloning DILexicalBlocks if their parent DISubprogram was not cloned.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125691/new/

https://reviews.llvm.org/D125691



More information about the llvm-commits mailing list