Thought this might be of interest to the compiler devs. The link is here:
https://github.com/75557032/llvmpasNote that the author seems to be a native Chinese speaker as most of the comments are written in Chinese, but the code itself is all clean "Borland style" stuff with clear English naming so it's still quite easy to get an idea of what's going on.
To be clear, it doesn't just implement a simple procedural Pascal like you might be expecting at first, but full Delphi/FPC style Object Pascal with class methods/interfaces/exceptions/e.t.c, complete with its own System unit. Overall I'd say it's at around a just-before-Delphi-2009 syntax level.
Here's an example of some IR output from using it to compile its System unit (with JavaScript code-embedding tags just for the "C-style" syntax highlighting):
define fastcc i8* @System.TObject.ClassType(i8* %Self)
{
%Self.addr = alloca i8*, align 4
%Result.addr = alloca i8*, align 4
%.1 = bitcast i8* %Self to i8**
%.2 = load i8*, i8** %.1
store i8* %.2, i8** %Result.addr
br label %.quit
.quit:
%.3 = load i8*, i8** %Result.addr
ret i8* %.3
}
I think this shows that it is indeed very feasible to fully represent Object Pascal in LLVM, considering the project seems to be the work of just one person, and makes me wonder what exactly the issues with the FPC LLVM backend were?