Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-10

Using LLVM with FPC

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

leledumbo

Since no one seems to be interested on this in Lazarus forum, I duplicate it here:

I'm not talking about generating LLVM IR code as FPC backend, instead I'd like to use it as normal library. Though it's written in C++, it has C interface, so I think it's possible. It's just, the header has a lot of macros and I hope somebody has already done the conversion (I don't want to waste time duplicating other's work). Does anybody has an info about it?

Additional question: if anybody has done an IRBuilder-like classes for FPC, please tell me. I need it for my bachelor graduation project.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Using-LLVM-with-FPC-tp3199368p3199368.html Sent from the Free Pascal - General mailing list .
Michael Van Canneyt
to leledumbo
leledumbo wrote 9 lines
Since no one seems to be interested on this in Lazarus forum, I duplicate it here: I'm not talking about generating LLVM IR code as FPC backend, instead I'd like to use it as normal library. Though it's written in C++, it has C interface, so I think it's possible. It's just, the header has a lot of macros and I hope somebody has already done the conversion (I don't want to waste time duplicating other's work). Does anybody has an info about it?

I am not aware of any existing translations.

Michael.

Adriaan van Os
to leledumbo: Since no one seems to be interested on this in Lazarus forum, I duplicate it here: I'm…
leledumbo wrote 8 lines
Since no one seems to be interested on this in Lazarus forum, I duplicate it here: I'm not talking about generating LLVM IR code as FPC backend, instead I'd like to use it as normal library. Though it's written in C++, it has C interface, so I think it's possible. It's just, the header has a lot of macros and I hope somebody has already done the conversion (I don't want to waste time duplicating other's work). Does anybody has an info about it?

Using LLVM libraries may look attractive, but the big disadvantage is that you are talking about a moving target. It will require maintainance (and probably a lot) with every release of LLVM. Also, as far as I know, the C interface is incomplete.

I believe that producing LLVM assembly is the best solution in the long run.

Regards,

Adriaan van Os

Sven Barth
to leledumbo
leledumbo wrote 6 lines
> I believe that producing LLVM assembly is the best solution in the long run. That's what I'm going to do if no one else ever started it (I'll try to make it as modular as possible so it can be used for other projects)

I don't know how far Jonas is with his LLVM branch, but you might want to take a look at it:

Web Interface:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/llvm/ (especially compiler/llvm subdirectory)

SVN:
http://svn.freepascal.org/svn/fpc/branches/llvm

Regards,
Sven

Jonas Maebe
to Sven Barth
Sven Barth wrote 12 lines
Am 05.10.2010 16:06, schrieb leledumbo: > >> I believe that producing LLVM assembly is the best solution in the >> long > run. > > That's what I'm going to do if no one else ever started it (I'll > try to make > it as modular as possible so it can be used for other projects) I don't know how far Jonas is with his LLVM branch, but you might want to take a look at it:

Not that far, and still not sure about the approach to take. Also note that the llvm branch currently probably does not work (as in: crashes if you try to use the compiler).

Jonas

Sven Barth
to Jonas Maebe
Jonas Maebe wrote 18 lines
On 05 Oct 2010, at 16:41, Sven Barth wrote: > Am 05.10.2010 16:06, schrieb leledumbo: >> >>> I believe that producing LLVM assembly is the best solution in the long >> run. >> >> That's what I'm going to do if no one else ever started it (I'll try >> to make >> it as modular as possible so it can be used for other projects) > > I don't know how far Jonas is with his LLVM branch, but you might want > to take a look at it: Not that far, and still not sure about the approach to take. Also note that the llvm branch currently probably does not work (as in: crashes if you try to use the compiler).

But do you already generate LLVM code? Because that's what the user seems to be interested in.

Regards,
Sven

Jonas Maebe
to Sven Barth
Sven Barth wrote
But do you already generate LLVM code?

No, only translating FPC types into LLVM type definitions has been implemented (but that's also the part that occasionally crashes since my last merge from trunk).

Jonas

Sven Barth
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 05 Oct 2010, at 16:52, Sven Barth wrote: > But do you already generate LLVM code? No, only translating FPC types into LLVM type definitions has been implemented (but that's also the part that occasionally crashes since my last merge from trunk).

Ok... I thought you already interfaced with LLVM somehow...

Regards,
Sven