Skip to content

Commit

Permalink
lib/Target/X86/X86ISelLowering.cpp: Introduce a new variable "IsWin64…
Browse files Browse the repository at this point in the history
…". No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124948 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed Feb 5, 2011
1 parent 9c7719e commit fb840c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
SmallVectorImpl<SDValue> &InVals) const {
MachineFunction &MF = DAG.getMachineFunction();
bool Is64Bit = Subtarget->is64Bit();
bool IsWin64 = Subtarget->isTargetWin64();
bool IsStructRet = CallIsStructReturn(Outs);
bool IsSibcall = false;

Expand Down Expand Up @@ -1945,7 +1946,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,

if (VA.isRegLoc()) {
RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
if (isVarArg && Subtarget->isTargetWin64()) {
if (isVarArg && IsWin64) {
// Win64 ABI requires argument XMM reg to be copied to the corresponding
// shadow reg if callee is a varargs function.
unsigned ShadowReg = 0;
Expand Down Expand Up @@ -2011,7 +2012,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
}
}

if (Is64Bit && isVarArg && !Subtarget->isTargetWin64()) {
if (Is64Bit && isVarArg && !IsWin64) {
// From AMD64 ABI document:
// For calls that may call functions that use varargs or stdargs
// (prototype-less calls or calls to functions containing ellipsis (...) in
Expand Down Expand Up @@ -2186,7 +2187,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
Ops.push_back(DAG.getRegister(X86::EBX, getPointerTy()));

// Add an implicit use of AL for non-Windows x86 64-bit vararg functions.
if (Is64Bit && isVarArg && !Subtarget->isTargetWin64())
if (Is64Bit && isVarArg && !IsWin64)
Ops.push_back(DAG.getRegister(X86::AL, MVT::i8));

if (InFlag.getNode())
Expand Down

0 comments on commit fb840c9

Please sign in to comment.