Add convenient helper for win64 check. Simplify things slightly.
authorAnton Korobeynikov <asl@math.spbu.ru>
Sat, 22 Mar 2008 20:57:27 +0000 (20:57 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sat, 22 Mar 2008 20:57:27 +0000 (20:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48691 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86Subtarget.h

index 3206e183eb7bbaf0426c9e77ffae0499e501dbb0..d4f4e265c2318eee2dfc1b72b069117acca29e2f 100644 (file)
@@ -101,8 +101,7 @@ def RetCC_X86_32 : CallingConv<[
 // This is the root return-value convention for the X86-64 backend.
 def RetCC_X86_64 : CallingConv<[
   // Mingw64 and native Win64 use Win64 CC
-  CCIfSubtarget<"isTargetMingw()", CCDelegateTo<RetCC_X86_Win64_C>>,
-  CCIfSubtarget<"isTargetWindows()", CCDelegateTo<RetCC_X86_Win64_C>>,
+  CCIfSubtarget<"isTargetWin64()", CCDelegateTo<RetCC_X86_Win64_C>>,
 
   // Otherwise, drop to normal X86-64 CC
   CCDelegateTo<RetCC_X86_64_C>
index 933c33e3d4d338b5b190d762741685be974c9b0d..dd2d7849d77fd9bf9bd2b90d71132acbfe59d905 100644 (file)
@@ -1009,7 +1009,7 @@ CCAssignFn *X86TargetLowering::CCAssignFnForNode(SDOperand Op) const {
   unsigned CC = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
   
   if (Subtarget->is64Bit()) {
-    if (Subtarget->isTargetWindows() || Subtarget->isTargetMingw())
+    if (Subtarget->isTargetWin64())
       return CC_X86_Win64_C;
     else {
       if (CC == CallingConv::Fast && PerformTailCallOpt)
index e34d1f1aeef2f6ee5ff87e1effcb92bb1d8e41ba..6488d474d1923e90a7aa68630a1a5a4445e7be0a 100644 (file)
@@ -138,6 +138,9 @@ public:
   bool isTargetCygMing() const { return (TargetType == isMingw ||
                                          TargetType == isCygwin); }
   bool isTargetCygwin() const { return TargetType == isCygwin; }
+  bool isTargetWin64() const {
+    return (Is64Bit && (TargetType == isMingw || TargetType == isWindows));
+  }
 
   std::string getDataLayout() const {
     const char *p;