Connection llvm ir

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?

Wonjun, Choi

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?

  I guess you want to link LLVM IR generated for different language from
different front end, right?

Regards,
chenwj

I want to call C function from fortran or call fortran function from C.

2011년 6월 15일 오전 11:59, 陳韋任 <chenwj@iis.sinica.edu.tw>님의 말:

Hi,

I want to call C function from fortran or call fortran function from C.

  I think you can get some insight from reading this,
  http://sysrun.haifa.il.ibm.com/hrl/greps2007/papers/greps-07-lto.pdf

Regards,
chenwj

Hi 최원준,

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.

Ciao, Duncan.

Hi chenwj,

I want to call C function from fortran or call fortran function from C.

   I think you can get some insight from reading this,
   http://sysrun.haifa.il.ibm.com/hrl/greps2007/papers/greps-07-lto.pdf

a bunch of issues discussed in that are GCC specific and don't apply to
LLVM. As far as I know GCC still has problems when doing LTO of multi
language programs, but LLVM never did [*].

Ciao,

Duncan.

[*] There is a theoretical issue if (eg) C++ exception handling code is
inlined into an Ada function containing Ada exception handling code.

> 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?

Regards,
chenwj

I want to call each language function from each language using llvm ir language.
Is this possible?

Wonjun, Choi

2011/6/16 陳韋任 <chenwj@iis.sinica.edu.tw>

Hi chenwj,