What are some issues with LLVM?

It’s pretty easy to build, just read the getting started guide.

I'm sorry, but anything that is likely to take many hours to build (as I estimated last time) on my slow 2-core PC is not going to be easy. Things that are supposed to take 5 minutes don't even work. Don't forget I'm on Windows. Developers assume people will use Linux, or download enough bits of it to make Windows work like Linux.

I simply don't believe in doing that.

I suspect a lot of your questions would be answered by having a quick skim of the docs.

Ha, ha! Maybe you think I haven't tried that? I first looked at llvm about a decade and a half ago; even then there were dozens of sets of docs. If I start here:

https://llvm.org/docs/

And click on the various links in turn, they reveal many, many more sub-links. I stopped counting at 100.

You should use the C++ api, or the C bindings, or some other programmatic way of constructing IR, and not try to generate textual IR. Emitting text IR is an anti-pattern, and will lead you to compatibility problems across versions.

I can't see why there is any more problem in generating text rather than binary, other than it is not as elegant and might be slower.

With binary there is the massive obstacle in creating bindings from my language to, presumably C++. I don't know C++. I don't know where the C API us, I simply wouldn't know where to start. I guess the docs assume you are using a mainstream language where someone else has already done all this work.

(How many functions are there in the LLVM API? 100, 1000, 10000? I know there are 260MB's worth of DLLs. It looks like years of effort to me.)

If was generating, say, textual ASM instead of using an API, I could even do it from BASIC with no messing about with any FFIs:

  PRINT "    xor rax, rax"

Ultra-simple, and a very low bar to getting at least that part of it going.

Clang can read both textual IR and bitcode, and feed it through the same optimization passes that it compiles IR translated from C with. No need to emit C from your language frontend.

OK, I'll have a further look when I'm more inclined to spend time on this. Although I'd earlier typed clang -help and was presented with 800 options which left me none the wiser as to what it could do.

/r/Compilers Thread Parent Link - quora.com