llvm::replaceDbgValueForAlloca

Replace dbg.value records when an alloca address is replaced.

Synopsis

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

void
replaceDbgValueForAlloca(
    AllocaInst* AI,
    Value* NewAllocaAddress,
    DIBuilder& Builder,
    int Offset = 0);

Description

Replaces multiple dbg.value records when the alloca it describes is replaced with a new value. If Offset is non-zero, a constant displacement is added to the expression (after the mandatory Deref). Offset can be negative. New dbg.value records are inserted at the locations of the instructions they replace.

Parameters

NameDescription
AIAlloca whose describing dbg.value records are rewritten.
NewAllocaAddressReplacement address for the alloca.
BuilderDIBuilder used to rewrite the dbg.value records.
OffsetConstant displacement added after the mandatory Deref.