[LLVMdev] Connection llvm ir

Duncan Sands baldrick at free.fr
Thu Jun 16 01:02:10 PDT 2011


Hi chenwj,

On 16/06/11 03:23, 陳韋任 wrote:
>>> I want to connect each llvm ir
>>>
>>> for example:
>>> 1. Turn C/C++ language into C_llvmIR assembly language using Clang
>>> 2. Turn Fortran language into Fortran_llvmIR assembly language using Dragonegg
>>> 3. Turn Python language into Python_llvmIR assembly language using Unladen-Swallow
>>> 4. Connect each llvm IR
>>>
>>> Is this possible?
>>
>> this should work fine: if you can compile to object code and successfully link
>> the object code to form a working program then you should be able to compile to
>> bitcode and link the bitcode (and get a working program).  I've done this for
>> programs made up of Ada/C/C++ and Fortran and it worked as expected.
>
>    He acutally want to call C function from fortran or call fortran function from C,
> for example. In your case, that will do?

I'm not sure what you are asking.  Of course you can call Fortran functions from
C and C functions from Fortran - people do this all the time.  You just need to
declare the external functions with the right prototypes.

Ciao, Duncan.



More information about the llvm-dev mailing list