mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-12 18:02:43 +00:00
Codegen support for fastcall & stdcall CC.
Patch by Ilya Okonsky! llvm-svn: 59080
This commit is contained in:
parent
7ae7d91ee0
commit
fdf389b9e4
@ -252,7 +252,10 @@ void CodeGenModule::SetFunctionAttributes(const Decl *D,
|
||||
|
||||
// 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
|
||||
|
17
clang/test/CodeGen/stdcall-fastcall.c
Normal file
17
clang/test/CodeGen/stdcall-fastcall.c
Normal file
@ -0,0 +1,17 @@
|
||||
// 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user