llvm::salvageDebugInfoImpl

Append an instruction's effect to a salvaged DIExpression operand list.

Synopsis

Declared in <llvm/Transforms/Utils/Local.h>

Value*
salvageDebugInfoImpl(
    Instruction& I,
    uint64_t CurrentLocOps,
    SmallVectorImpl<uint64_t>& Ops,
    SmallVectorImpl<Value*>& AdditionalValues);

Description

Given an instruction I and DIExpression DIExpr operating on it, append the effects of I to the DIExpression operand list Ops, or return nullptr if it cannot be salvaged. CurrentLocOps is the number of SSA values referenced by the incoming Ops.

/ I = add %a, i32 1

Return = %a Ops = llvm::dwarf::DW_OP_lit1 llvm::dwarf::DW_OP_add

I = add %a, %b

Return = %a Ops = llvm::dwarf::DW_OP_LLVM_arg0 llvm::dwarf::DW_OP_add AdditionalValues = %b

Return Value

the first non-constant operand implicitly referred to by Ops. If I references more than one non-constant operand, any additional operands are added to AdditionalValues.

Parameters

NameDescription
IInstruction whose effect may be appended to Ops.
CurrentLocOpsNumber of SSA values already referenced by Ops.
OpsDIExpression operand list being rewritten.
AdditionalValuesExtra non-constant operands referenced by I.