Changes to TargetLowering::{LowerCallTo,LowerCall}

A change has just been committed that changes the interface for TargetLowering::LowerCallTo and TargetLowering::LowerCall. Instead of passing a mess of parameters to these functions, a new structure has been created that encapsulates these parameters. The motivation is that additional fields can be added to this structure (with appropriate changes to SelectionDAGBuilder for populating the new fields) without forcing an ABI change on each and every target. In-tree targets have been updated accordingly, so no change is required. However, if you have an out-of-tree target that is following trunk, please be aware that this will break your build. Please see any in-tree target for the new interface and how to access the values that used to be available as individual function parameters.

As a quick example, the ARM implementation for LowerCall is now:


ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,

SmallVectorImpl &InVals) const {

SelectionDAG &DAG = CLI.DAG;

DebugLoc &dl = CLI.DL;

SmallVector<ISD::OutputArg, 32> &Outs = CLI.Outs;

SmallVector<SDValue, 32> &OutVals = CLI.OutVals;

SmallVector<ISD::InputArg, 32> &Ins = CLI.Ins;

SDValue Chain = CLI.Chain;

SDValue Callee = CLI.Callee;

bool &isTailCall = CLI.IsTailCall;

CallingConv::ID CallConv = CLI.CallConv;

bool doesNotRet = CLI.DoesNotReturn;

bool isVarArg = CLI.IsVarArg;

The CallLoweringInfo struct now contains all parameters that were originally available as parameters. The InVals vector was left as a parameter since it is the responsibility of the LowerCall implementation to fill it and does not represent input information about the call (unlike IsTailCall which is an in/out parameter, and hence added to the new struct).