Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Machine CPU: skylake
- Machine info: x86_64-pc-windows-msvc
- struct SomeStruct
- {
- static double Callback(uint8_t* ptr, double foo) { return foo * 2; }
- };
- define i32 @main(i32, i8**) {
- varinit:
- // omitted here: initialize %ptr from i8**. This IR code works.
- %1 = call double @"SomeStruct::Callback"(i8* %ptr, double 2.700000e+01)
- ret i32 0
- }
- declare double @"SomeStruct::Callback"(i8*, double)
- // during initialization of the function
- auto function = llvm::Function::Create(functionType, llvm::Function::ExternalLinkage, name, module);
- function->setCallingConv(llvm::CallingConv::X86_64_Win64);
- ...
- // during calling of the function
- call->setCallingConv(llvm::CallingConv::X86_64_Win64);
- movq (%rdx), %rcx
- vmovss __real@41d80000(%rip), %xmm1
- callq "SomeStruct::Callback"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement