[LLVMdev] Built LLVM 1.8 on VC8, invalid iterator issue/fix, some questions

Morten Ofstad morten at hue.no
Fri Aug 25 02:48:17 PDT 2006


srhilber at ncsu.edu wrote:
> Hello,
> 
> I've managed to get LLVM 1.8 to build properly with MSVC8 with some
> effort. Most of the changes necessary were very minor C++ usage issues;
> for instance, VC8 can't deal with prototyping something that's really a
> class as 'struct Foo;' or vice versa (it creates issues with matching
> function signatures during linking.) Additionally, I had to do quite a few
> updates to the included VC7.1 project file after doing an upgrade to a VC8
> project (the project file appears to be somewhat out of date.)

I did the same thing a while ago, and submitted some patches. The problem with structs and classes crop up every now and 
again when someone adds new code, I fixed lots of these when LLVM was first ported to VC7 (which has the same issue).

> However, there appears to be some issue with using an invalid iterator in
> the X86 backend that appears when I build with VC8. I've managed to fix it
> by duplicating the std::vector in question before iterating through it,
> but I'm too new to the code to be able to say whether it's the "right"
> fix.

The VC8 STL implementation is basically asserting everything when running in debug mode - I submitted patches for an 
issue where it checks that the operator < is antisymmetric ( given a < b it would assert(! b < a) ) which doesn't work 
if the operator is implemented so it can only compare your class to an int and not the other way around. Sometimes it's 
a bit too restrictive, but usually the code it complains about will benefit from a cleanup anyway.

You were asking if a VC8 port is desired, and the answer is definitly 'yes' - patches for VC8 have already been accepted 
and at least I'm using the VC8 port (... of release 1.5) I will upgrade to the current release when I have some free 
time, but the 1.5 release is working fine for us so at the moment it's one of those "don't fix what isn't broken" 
situations.

m.



More information about the llvm-dev mailing list