[llvm-commits] [llvm] r126862 - in /llvm/trunk: include/llvm/CallingConv.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Target/X86/X86CallingConv.td lib/VMCore/AsmWriter.cpp
Tilmann Scheller
tilmann.scheller at googlemail.com
Wed Mar 2 11:29:22 PST 2011
Author: tilmann
Date: Wed Mar 2 13:29:22 2011
New Revision: 126862
URL: http://llvm.org/viewvc/llvm-project?rev=126862&view=rev
Log:
Add Win64 thiscall calling convention.
Modified:
llvm/trunk/include/llvm/CallingConv.h
llvm/trunk/lib/AsmParser/LLLexer.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/AsmParser/LLToken.h
llvm/trunk/lib/Target/X86/X86CallingConv.td
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/include/llvm/CallingConv.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallingConv.h?rev=126862&r1=126861&r2=126862&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CallingConv.h (original)
+++ llvm/trunk/include/llvm/CallingConv.h Wed Mar 2 13:29:22 2011
@@ -94,7 +94,10 @@
/// MBLAZE_INTR - Calling convention used for MBlaze interrupt support
/// routines (i.e. GCC's save_volatiles attribute).
- MBLAZE_SVOL = 74
+ MBLAZE_SVOL = 74,
+
+ /// Win64_ThisCall - Calling convention used for method calls on Win64.
+ Win64_ThisCall = 75
};
} // End CallingConv namespace
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=126862&r1=126861&r2=126862&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Wed Mar 2 13:29:22 2011
@@ -549,6 +549,7 @@
KEYWORD(msp430_intrcc);
KEYWORD(ptx_kernel);
KEYWORD(ptx_device);
+ KEYWORD(win64_thiscallcc);
KEYWORD(cc);
KEYWORD(c);
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=126862&r1=126861&r2=126862&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Mar 2 13:29:22 2011
@@ -1087,6 +1087,7 @@
/// ::= 'msp430_intrcc'
/// ::= 'ptx_kernel'
/// ::= 'ptx_device'
+/// ::= 'win64_thiscallcc'
/// ::= 'cc' UINT
///
bool LLParser::ParseOptionalCallingConv(CallingConv::ID &CC) {
@@ -1104,6 +1105,7 @@
case lltok::kw_msp430_intrcc: CC = CallingConv::MSP430_INTR; break;
case lltok::kw_ptx_kernel: CC = CallingConv::PTX_Kernel; break;
case lltok::kw_ptx_device: CC = CallingConv::PTX_Device; break;
+ case lltok::kw_win64_thiscallcc:CC = CallingConv::Win64_ThisCall; break;
case lltok::kw_cc: {
unsigned ArbitraryCC;
Lex.Lex();
Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=126862&r1=126861&r2=126862&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Wed Mar 2 13:29:22 2011
@@ -74,6 +74,7 @@
kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
kw_msp430_intrcc,
kw_ptx_kernel, kw_ptx_device,
+ kw_win64_thiscallcc,
kw_signext,
kw_zeroext,
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=126862&r1=126861&r2=126862&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Wed Mar 2 13:29:22 2011
@@ -215,6 +215,13 @@
// The first 4 integer arguments are passed in integer registers.
CCIfType<[i32], CCAssignToRegWithShadow<[ECX , EDX , R8D , R9D ],
[XMM0, XMM1, XMM2, XMM3]>>,
+
+ // Do not pass the sret argument in RCX, the Win64 thiscall calling
+ // convention requires "this" to be passed in RCX.
+ CCIfCC<"CallingConv::Win64_ThisCall",
+ CCIfSRet<CCIfType<[i64], CCAssignToRegWithShadow<[RDX , R8 , R9 ],
+ [XMM1, XMM2, XMM3]>>>>,
+
CCIfType<[i64], CCAssignToRegWithShadow<[RCX , RDX , R8 , R9 ],
[XMM0, XMM1, XMM2, XMM3]>>,
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=126862&r1=126861&r2=126862&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Mar 2 13:29:22 2011
@@ -1586,6 +1586,7 @@
case CallingConv::MSP430_INTR: Out << "msp430_intrcc "; break;
case CallingConv::PTX_Kernel: Out << "ptx_kernel"; break;
case CallingConv::PTX_Device: Out << "ptx_device"; break;
+ case CallingConv::Win64_ThisCall:Out << "win64_thiscallcc "; break;
default: Out << "cc" << F->getCallingConv() << " "; break;
}
@@ -1858,6 +1859,7 @@
case CallingConv::MSP430_INTR: Out << " msp430_intrcc "; break;
case CallingConv::PTX_Kernel: Out << " ptx_kernel"; break;
case CallingConv::PTX_Device: Out << " ptx_device"; break;
+ case CallingConv::Win64_ThisCall:Out << " win64_thiscallcc "; break;
default: Out << " cc" << CI->getCallingConv(); break;
}
@@ -1914,6 +1916,7 @@
case CallingConv::MSP430_INTR: Out << " msp430_intrcc "; break;
case CallingConv::PTX_Kernel: Out << " ptx_kernel"; break;
case CallingConv::PTX_Device: Out << " ptx_device"; break;
+ case CallingConv::Win64_ThisCall:Out << " win64_thiscallcc "; break;
default: Out << " cc" << II->getCallingConv(); break;
}
More information about the llvm-commits
mailing list