[cfe-dev] Newby questions
hartmut.kaiser at gmail.com
Fri Aug 31 18:41:10 PDT 2007
Chris Lattner wrote:
> > 1. I couldn't find any build instructions/project files to build
> > clang using
> > MSVC8, so I decided to create these. I tried to use similar build
> > settings
> > as have been used in the corresponding MSVC project files
> for LLVM.
> > Almost
> > everything compiled fine, except for a bigger issue and
> some really
> > minor
> > platform specific issues, which I have been able to address. The
> > bigger
> > issue is that the clang::FileEntry class retrieves the size of the
> > file
> > using stat, but because of the EOL translation done on Windows the
> > file
> > usually is smaller in memory than it is on disk. I
> introduced a hack
> > in the
> > ReadFileFast() function to circumvent an infinite loop there, but
> > this has
> > other effects I'm not able to resolve ad hoc. How is this
> solved in
> > LLVM?
> LLVM has a system abstraction library, but it needs to be properly
> extended to handle this case. Can you please send in the patch for
> for the change?
The O_BINARY flag did the trick (see my other mail). I'll submit a patch for
the other changes.
> > 2. The clang driver builds and runs for me now (after this
> hack) but
> > I'm
> > getting an assertion when I started to run the array.c test in the
> > test/CodeGen directory: Assertion failed: isa<X>(Val) && "cast<Ty>()
> > argument of incompatible type!", file
> > c:\CVS\llvm\include\llvm/Support/Casting.h, line 199. Is this a
> > known issue
> > or did something go wrong during my compilation, or is this
> > to the
> > issue I described above?
> I'm away from my computer, so I can't check right now. It is
> that it is a real regression, but we also haven't done much
> testing on
> windows, so it may be a platform issue.
> > Unfortunately many of these tests fail (produce wrongly
> > preprocessed output). Is this a known issue?
> Can you give an example? When producing a .i file, clang
> futzes with
> whitespace a bit to make sure the output will relex into the proper
> token stream (this only affects .i file writing, not the
> parser). You
> may be hitting this or it may be a real bug. If it is a bug, we'll
> fix it :)
Fixed with the O_BINARY patch. Sorry for the noise.
> > 4. Is there any interest in getting the MSVC8 project files
> > mentioned above?
> > If yes, what's the suggested procedure?
> Yes! Please send them to the cfe-commits list.
More information about the cfe-dev