aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-22 20:57:27 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-22 20:57:27 +0000
commit06d49b0cc19c9d410df53fc7f238c9452a2f8b08 (patch)
tree885634490f5bd5201032256ce5590d9b22f5dde9
parent99bd18866354e381915a5084cd3c24a75e79b169 (diff)
downloadexternal_llvm-06d49b0cc19c9d410df53fc7f238c9452a2f8b08.zip
external_llvm-06d49b0cc19c9d410df53fc7f238c9452a2f8b08.tar.gz
external_llvm-06d49b0cc19c9d410df53fc7f238c9452a2f8b08.tar.bz2
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
-rw-r--r--lib/Target/X86/X86CallingConv.td3
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp2
-rw-r--r--lib/Target/X86/X86Subtarget.h3
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/X86/X86CallingConv.td b/lib/Target/X86/X86CallingConv.td
index 3206e18..d4f4e26 100644
--- a/lib/Target/X86/X86CallingConv.td
+++ b/lib/Target/X86/X86CallingConv.td
@@ -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>
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 933c33e..dd2d784 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -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)
diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h
index e34d1f1..6488d47 100644
--- a/lib/Target/X86/X86Subtarget.h
+++ b/lib/Target/X86/X86Subtarget.h
@@ -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;