[fpc-devel] RTTI

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Nov 27 12:36:56 CET 2015


Maciej Izak wrote:
> 2015-11-27 11:59 GMT+01:00 Jonas Maebe <jonas.maebe at elis.ugent.be
> <mailto:jonas.maebe at elis.ugent.be>>:
>
>     No. LLVM IR platform dependent. So if you want to compile Pascal to
>     "Javascript LLVM IR", you first have to add a "Javascript LLVM IR"
>     platform to FPC. That includes both compiler and RTL support.
>
> I thought it would be simpler.

If you perform a readln, you need to call some kind of OS or platform 
function to read data from standard input. From Javascript you obviously 
cannot access the system calls or C library of the underlying operating 
system (and if you could, it wouldn't help much, since you would want to 
read from a browser Windows), so you need an RTL.

In general, as I've mentioned several times before on this list, LLVM is 
not a panacea:
* LLVM IR completely platform dependent, so it does not automagically 
give us access to all targets supported by Clang/LLVM. In particular the 
way calling conventions are handled is completely platform dependent, 
and you cannot generate "generic LLVM IR" that will work on all 
platforms (at least not in an ABI-compliant way), and of course the size 
of integer
* LLVM does not care about backward compatibility, so FPC will always 
only support a subset of available LLVM versions
* LLVM does not support the Borland "register" calling convention, so 
i386 support will be impossible until someone adds that to LLVM


Jonas



More information about the fpc-devel mailing list