[LLVMdev] About JIT by LLVM 2.9 or later

Óscar Fuentes
Wed, 02 Nov 2011 02:03:31 -0000

[snip]

> 1. Why it generates "ret 4" but not "ret" without
modify esp?

Already answered on my previous message.

> 2. Does it doesn't support Microsoft Visual C++ compiler directly ?

LLVM doesn't support the full Microsoft ABI. Specially with
passing/returning structs (or C++ objects). The workaround for that is
to always pass/return pointers to structs.

> 3. I want to integrate LLVM JIT in MSVC, is it possible? what I will do,
> such as generate a adapter function ? Any porting document for it?

Using the JIT from MSVC is not harder than doing the same with any other
compiler (g++, for instance) except from the problem noted on the
previous response.

> 4. Does Clang support MS's call convention? If it does, how it work? I
> traced into it, but code is too large.

Because Clang is based on LLVM, it does not support the MSVC calling
convention due to the limitations noted on the answer to question 2.

> 5. Does it support Mingw directly ?

I'm afraid that you will discover compatibility problems among Clang and
MinGW due to the struct return problem: MinGW does it right, because it
follows the MS C ABI.

> 6. Does x64 work if your solution is applied ?

Sorry, I have no experience with LLVM and Windows calling conventions on
x64.