Patch by Ilya Okonsky!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59080
91177308-0d34-0410-b5e6-
96231b3b80d8
// Set the appropriate calling convention for the Function.
if (D->getAttr<FastCallAttr>())
- F->setCallingConv(llvm::CallingConv::Fast);
+ F->setCallingConv(llvm::CallingConv::X86_FastCall);
+
+ if (D->getAttr<StdCallAttr>())
+ F->setCallingConv(llvm::CallingConv::X86_StdCall);
}
/// SetFunctionAttributesForDefinition - Set function attributes
--- /dev/null
+// RUN: clang -emit-llvm < %s | grep 'fastcallcc' | count 4
+// RUN: clang -emit-llvm < %s | grep 'stdcallcc' | count 4
+
+void __attribute__((fastcall)) f1(void);
+void __attribute__((stdcall)) f2(void);
+void __attribute__((fastcall)) f3(void) {
+ f1();
+}
+void __attribute__((stdcall)) f4(void) {
+ f2();
+}
+
+int main(void) {
+ f3(); f4();
+ return 0;
+}
+