LLVM binaries for Windows and more

Von: LLVM Developers Mailing List <llvmdev@cs.uiuc.edu>
Gesendet: 12.06.07 19:24:12
An: LLVM Developers Mailing List <llvmdev@cs.uiuc.edu>
Betreff: Re: [LLVMdev] LLVM binaries for Windows and more

> I want to use LLVM for my own "pet" programming language compiler as a backend.
> Currently it generates C code, but I am not satisfied with this approach as generating
> high-level C (with proper type declarations!) is horrible.
> So here are my questions/problems with LLVM:
>
> 1.) Are there operations that add, sub, mul integers with overflow
> checking? How much work would it be to add those? They are needed
> for my programming language, but I think Pascal and Ada need those
> too.

No not yet, the recommended solution is to compute overflow manually with
arithmetic after you do the operations you need. In time LLVM will be
extended to support this capability.

Ok, but I fear the optimizer is not smart enough to produce something like:

a+b -->

          mov eax, a
          add eax, b
          jno theEnd
          call raiseOverflow
        theEnd:

It is not critical though - I turn off overflow checking after debugging anyway.

> 2.) The version 2.0 of your source code does not compile with Microsoft
> Visual C++ 2005 Express Edition. (By the way, is it documented that
> I need Bison? I figured that out myself...):

You might want to try LLVM CVS. I believe there are several fixes in CVS
that were not in 2.0. If that doesn't work, we will gladly accept patches
to make it work.

> I fixed this by adding a ``return 0;`` at the end of the method. But why
> don't you just provide binaries for windows? I could send you the
> binaries that I built - I have not yet tested them though.

The LLVM community consists of volenteers, and noone volenteered for 2.0
:slight_smile:

-Chris

I volunteer. As soon as I get everything to work.

Next problem: I now have the hello.bc file compiled. But how do I get an executable from this? I tried:

C:\Eigenes\compiler\llvm-2.0\win32\release>llvm-ld -o=hellow.exe hellow.bc
llvm-ld: Could not find llvm-stub.exe executable!

So, I don't have "llvm-stub.exe". But why did it not build one? And what is the
difference between "llvm-ld" and "llvm-link"? "llvm-link" does not work either.

Thanks,

Andreas

But why don't you just provide binaries for windows? I could send you the binaries that I built - I have not yet tested them though.

I volunteer. As soon as I get everything to work.

I believe Express versions of MSVC do not generate as gooder code as the full releases of Visual Studio. We should check this just in case.

Aaron

No not yet, the recommended solution is to compute overflow manually with
arithmetic after you do the operations you need. In time LLVM will be
extended to support this capability.

Ok, but I fear the optimizer is not smart enough to produce something like:

a+b -->

         mov eax, a
         add eax, b
         jno theEnd
         call raiseOverflow
       theEnd:

It is not critical though - I turn off overflow checking after debugging anyway.

It definitely isn't right now. When we get people generating lots of this code, suddenly it becomes worthwhile to optimize it :slight_smile:

:slight_smile:

-Chris

I volunteer. As soon as I get everything to work.

Next problem: I now have the hello.bc file compiled. But how do I get an executable from this? I tried:

C:\Eigenes\compiler\llvm-2.0\win32\release>llvm-ld -o=hellow.exe hellow.bc
llvm-ld: Could not find llvm-stub.exe executable!

So, I don't have "llvm-stub.exe". But why did it not build one? And what is the
difference between "llvm-ld" and "llvm-link"? "llvm-link" does not work either.

Try passing -native.

-Chris