MCPcopy Create free account
hub / github.com/beefytech/Beef / GetLLVMCallingConv

Function GetLLVMCallingConv

IDEHelper/Compiler/BfIRCodeGen.cpp:217–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215{};
216
217static int GetLLVMCallingConv(BfIRCallingConv callingConv, BfTargetTriple& targetTriple)
218{
219 int llvmCallingConv = llvm::CallingConv::C;
220
221 if (targetTriple.GetMachineType() == BfMachineType_AArch64)
222 {
223 if (callingConv == BfIRCallingConv_CDecl)
224 llvmCallingConv = llvm::CallingConv::C;
225 else
226 llvmCallingConv = llvm::CallingConv::PreserveMost;
227 }
228 else
229 {
230 if (callingConv == BfIRCallingConv_ThisCall)
231 llvmCallingConv = llvm::CallingConv::X86_ThisCall;
232 else if (callingConv == BfIRCallingConv_StdCall)
233 llvmCallingConv = llvm::CallingConv::X86_StdCall;
234 else if (callingConv == BfIRCallingConv_FastCall)
235 llvmCallingConv = llvm::CallingConv::X86_FastCall;
236 else if (callingConv == BfIRCallingConv_CDecl)
237 llvmCallingConv = llvm::CallingConv::C;
238 }
239
240 return llvmCallingConv;
241}
242
243static llvm::GlobalValue::LinkageTypes LLVMMapLinkageType(BfIRLinkageType linkageType)
244{

Callers 1

HandleNextCmdMethod · 0.85

Calls 1

GetMachineTypeMethod · 0.80

Tested by

no test coverage detected