llvm::promoteCall

Promote the given indirect call site to unconditionally call Callee.

Synopsis

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

CallBase&
promoteCall(
    CallBase& CB,
    Function* Callee,
    CastInst** RetBitCast = nullptr);

Description

This function promotes the given call site, returning the direct call or invoke instruction. If the function type of the call site doesn't match that of the callee, bitcast instructions are inserted where appropriate. If RetBitCast is non-null, it will be used to store the return value bitcast, if created.

Return Value

The promoted direct call or invoke instruction.

Parameters

NameDescription
CBIndirect call site to promote.
CalleeFunction to call directly after promotion.
RetBitCastOptional out-parameter for a created return-value bitcast.