Add convenient helper for win64 check. Simplify things slightly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48691 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-03-22 20:57:27 +00:00
parent 8f88cb0899
commit 1a979d9eab
3 changed files with 5 additions and 3 deletions

View File

@ -101,8 +101,7 @@ def RetCC_X86_32 : CallingConv<[
// This is the root return-value convention for the X86-64 backend. // This is the root return-value convention for the X86-64 backend.
def RetCC_X86_64 : CallingConv<[ def RetCC_X86_64 : CallingConv<[
// Mingw64 and native Win64 use Win64 CC // Mingw64 and native Win64 use Win64 CC
CCIfSubtarget<"isTargetMingw()", CCDelegateTo<RetCC_X86_Win64_C>>, CCIfSubtarget<"isTargetWin64()", CCDelegateTo<RetCC_X86_Win64_C>>,
CCIfSubtarget<"isTargetWindows()", CCDelegateTo<RetCC_X86_Win64_C>>,
// Otherwise, drop to normal X86-64 CC // Otherwise, drop to normal X86-64 CC
CCDelegateTo<RetCC_X86_64_C> CCDelegateTo<RetCC_X86_64_C>

View File

@ -1009,7 +1009,7 @@ CCAssignFn *X86TargetLowering::CCAssignFnForNode(SDOperand Op) const {
unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue(); unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
if (Subtarget->is64Bit()) { if (Subtarget->is64Bit()) {
if (Subtarget->isTargetWindows() || Subtarget->isTargetMingw()) if (Subtarget->isTargetWin64())
return CC_X86_Win64_C; return CC_X86_Win64_C;
else { else {
if (CC == CallingConv::Fast && PerformTailCallOpt) if (CC == CallingConv::Fast && PerformTailCallOpt)

View File

@ -138,6 +138,9 @@ public:
bool isTargetCygMing() const { return (TargetType == isMingw || bool isTargetCygMing() const { return (TargetType == isMingw ||
TargetType == isCygwin); } TargetType == isCygwin); }
bool isTargetCygwin() const { return TargetType == isCygwin; } bool isTargetCygwin() const { return TargetType == isCygwin; }
bool isTargetWin64() const {
return (Is64Bit && (TargetType == isMingw || TargetType == isWindows));
}
std::string getDataLayout() const { std::string getDataLayout() const {
const char *p; const char *p;