diff options
| author | Jeremy Morse <jeremy.morse.llvm@gmail.com> | 2019-02-05 11:11:28 +0000 |
|---|---|---|
| committer | Jeremy Morse <jeremy.morse.llvm@gmail.com> | 2019-02-05 11:11:28 +0000 |
| commit | 84ca706be1dba3b9a7eb10a3620dfd13f089907e (patch) | |
| tree | 8a304e1d92f58578297ce3f036ff80121d08f4c6 /llvm/include | |
| parent | 72798954544f46111a106c44b26e5ad8b77bbd05 (diff) | |
| download | bcm5719-llvm-84ca706be1dba3b9a7eb10a3620dfd13f089907e.tar.gz bcm5719-llvm-84ca706be1dba3b9a7eb10a3620dfd13f089907e.zip | |
[DebugInfo][NFCI] Split salvageDebugInfo into helper functions
Some use cases are appearing where salvaging is needed that does not
correspond to an instruction being deleted -- for example an instruction
being sunk, or a Value not being available in a block being isel'd.
Enable more fine grained control over how salavging occurs by splitting
the logic into helper functions, separating things that are specific to
working on DbgVariableIntrinsics from those specific to interpreting IR
and building DIExpressions.
Differential Revision: https://reviews.llvm.org/D57696
llvm-svn: 353156
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Transforms/Utils/Local.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h index eed17d7c88b..22276d1c709 100644 --- a/llvm/include/llvm/Transforms/Utils/Local.h +++ b/llvm/include/llvm/Transforms/Utils/Local.h @@ -341,6 +341,18 @@ void replaceDbgValueForAlloca(AllocaInst *AI, Value *NewAllocaAddress, /// Returns true if any debug users were updated. bool salvageDebugInfo(Instruction &I); +/// Implementation of salvageDebugInfo, applying only to instructions in +/// \p Insns, rather than all debug users of \p I. +bool salvageDebugInfoForDbgValues(Instruction &I, + ArrayRef<DbgVariableIntrinsic *> Insns); + +/// Given an instruction \p I and DIExpression \p DIExpr operating on it, write +/// the effects of \p I into the returned DIExpression, or return nullptr if +/// it cannot be salvaged. \p StackVal: whether DW_OP_stack_value should be +/// appended to the expression. +DIExpression *salvageDebugInfoImpl(Instruction &I, DIExpression *DIExpr, + bool StackVal); + /// Point debug users of \p From to \p To or salvage them. Use this function /// only when replacing all uses of \p From with \p To, with a guarantee that /// \p From is going to be deleted. |

