Using LLVM with FPC

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Using LLVM with FPC

leledumbo
Administrator
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.
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Michael Van Canneyt


On Tue, 5 Oct 2010, leledumbo wrote:

>
> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Adriaan van Os-2
In reply to this post by leledumbo
leledumbo wrote:
> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

leledumbo
Administrator
> 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)
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Sven Barth-2
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:

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Jonas Maebe-2

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).


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Sven Barth-2
Am 05.10.2010 16:48, schrieb Jonas Maebe:

>
> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Jonas Maebe-2

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).


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

Sven Barth-2
Am 05.10.2010 16:58, schrieb Jonas Maebe:
>
> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM with FPC

leledumbo
Administrator
OK, it seems that I should take the hardcoder approach :)