Change FastISel::CallLoweringInfo::CS to be an ImmutableCallSite instead of a pointer. NFCI.

This is the same as what was done to the CallLoweringInfo in
TargetLowering.h in r309159.

This is just a step on the way to replacing this with CallBase.
This commit is contained in:
Craig Topper 2020-04-10 23:42:09 -07:00
parent 7824768b2e
commit 9c1842d8af
3 changed files with 14 additions and 14 deletions

View File

@ -86,7 +86,7 @@ public:
const Value *Callee = nullptr;
MCSymbol *Symbol = nullptr;
ArgListTy Args;
ImmutableCallSite *CS = nullptr;
ImmutableCallSite CS;
MachineInstr *Call = nullptr;
Register ResultReg;
unsigned NumResultRegs = 0;
@ -103,7 +103,7 @@ public:
CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
const Value *Target, ArgListTy &&ArgsList,
ImmutableCallSite &Call) {
ImmutableCallSite Call) {
RetTy = ResultTy;
Callee = Target;
@ -118,14 +118,14 @@ public:
Args = std::move(ArgsList);
NumFixedArgs = FuncTy->getNumParams();
CS = &Call;
CS = Call;
return *this;
}
CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
MCSymbol *Target, ArgListTy &&ArgsList,
ImmutableCallSite &Call,
ImmutableCallSite Call,
unsigned FixedArgs = ~0U) {
RetTy = ResultTy;
Callee = Call.getCalledValue();
@ -142,7 +142,7 @@ public:
Args = std::move(ArgsList);
NumFixedArgs = (FixedArgs == ~0U) ? FuncTy->getNumParams() : FixedArgs;
CS = &Call;
CS = Call;
return *this;
}

View File

@ -1250,11 +1250,11 @@ bool FastISel::lowerCallTo(CallLoweringInfo &CLI) {
CLI.Call->setPhysRegsDeadExcept(CLI.InRegs, TRI);
if (CLI.NumResultRegs && CLI.CS)
updateValueMap(CLI.CS->getInstruction(), CLI.ResultReg, CLI.NumResultRegs);
updateValueMap(CLI.CS.getInstruction(), CLI.ResultReg, CLI.NumResultRegs);
// Set labels for heapallocsite call.
if (CLI.CS)
if (MDNode *MD = CLI.CS->getInstruction()->getMetadata("heapallocsite"))
if (MDNode *MD = CLI.CS.getInstruction()->getMetadata("heapallocsite"))
CLI.Call->setHeapAllocMarker(*MF, MD);
return true;

View File

@ -3159,7 +3159,7 @@ bool X86FastISel::fastLowerArguments() {
static unsigned computeBytesPoppedByCalleeForSRet(const X86Subtarget *Subtarget,
CallingConv::ID CC,
ImmutableCallSite *CS) {
ImmutableCallSite CS) {
if (Subtarget->is64Bit())
return 0;
if (Subtarget->getTargetTriple().isOSMSVCRT())
@ -3169,8 +3169,8 @@ static unsigned computeBytesPoppedByCalleeForSRet(const X86Subtarget *Subtarget,
return 0;
if (CS)
if (CS->arg_empty() || !CS->paramHasAttr(0, Attribute::StructRet) ||
CS->paramHasAttr(0, Attribute::InReg) || Subtarget->isTargetMCU())
if (CS.arg_empty() || !CS.paramHasAttr(0, Attribute::StructRet) ||
CS.paramHasAttr(0, Attribute::InReg) || Subtarget->isTargetMCU())
return 0;
return 4;
@ -3192,13 +3192,13 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
bool IsWin64 = Subtarget->isCallingConvWin64(CC);
const CallInst *CI =
CLI.CS ? dyn_cast<CallInst>(CLI.CS->getInstruction()) : nullptr;
CLI.CS ? dyn_cast<CallInst>(CLI.CS.getInstruction()) : nullptr;
const Function *CalledFn = CI ? CI->getCalledFunction() : nullptr;
// Call / invoke instructions with NoCfCheck attribute require special
// handling.
const auto *II =
CLI.CS ? dyn_cast<InvokeInst>(CLI.CS->getInstruction()) : nullptr;
CLI.CS ? dyn_cast<InvokeInst>(CLI.CS.getInstruction()) : nullptr;
if ((CI && CI->doesNoCfCheck()) || (II && II->doesNoCfCheck()))
return false;
@ -3244,7 +3244,7 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
return false;
// Don't know about inalloca yet.
if (CLI.CS && CLI.CS->hasInAllocaArgument())
if (CLI.CS && CLI.CS.hasInAllocaArgument())
return false;
for (auto Flag : CLI.OutFlags)
@ -3275,7 +3275,7 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
auto *TI = dyn_cast<TruncInst>(Val);
unsigned ResultReg;
if (TI && TI->getType()->isIntegerTy(1) && CLI.CS &&
(TI->getParent() == CLI.CS->getInstruction()->getParent()) &&
(TI->getParent() == CLI.CS.getInstruction()->getParent()) &&
TI->hasOneUse()) {
Value *PrevVal = TI->getOperand(0);
ResultReg = getRegForValue(PrevVal);