[PATCH] D107383: Streamline the API of salvageDebugInfoImpl (NFC)

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 11:49:10 PDT 2021


aprantl created this revision.
aprantl added reviewers: jmorse, vsk, StephenTozer, Orlando.
aprantl added a project: debug-info.
Herald added subscribers: lxfind, hiraditya.
aprantl requested review of this revision.
Herald added a project: LLVM.

This patch refactors / simplifies salvageDebugInfoImpl(). The goal here is to simplify the implementation of coro::salvageDebugInfo() in a followup patch.

1. Change the return value to `I.getOperand(0)`. Currently users of salvageDebugInfoImpl() assume that the first operand is `I.getOperand(0)`. This patch makes this information explicit. A nice side-effect of this change is that it allows us to salvage expressions such as `add i8 1, %a` in the future.
2. Factor out the creation of a DIExpression and return an array of DIExpression operations instead. This change allows users that call salvageDebugInfoImpl() in a loop to avoid the costly creation of temporary DIExpressions and to defer the creation of a DIExpression until the end.

This patch does not change any functionality.


https://reviews.llvm.org/D107383

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/lib/Transforms/Utils/Local.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107383.363822.patch
Type: text/x-patch
Size: 12241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210803/2c632f94/attachment.bin>


More information about the llvm-commits mailing list