[cfe-dev] Newby questions

Hartmut Kaiser hartmut.kaiser at gmail.com
Fri Aug 31 16:07:45 PDT 2007

Hi all,

I'm new to this list and this project, which IMHO is very important for the
whole C++ community. I have a couple of questions - please excuse my
ignorance if these have been answered before.

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?

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 related to the
issue I described above?

3. After getting these assertions I moved to the test/Lexer directory to
see, if the preprocessor is working. The tests there seem to pass. So I
started to feed the files from the Boost.Wave testsuite to clang in pp mode
(clang -E). Unfortunately many of these tests fail (produce wrongly
preprocessed output). Is this a known issue? Would there be any interest in
using Boost.Wave as the preprocessor/lexer for clang?

4. Is there any interest in getting the MSVC8 project files mentioned above?
If yes, what's the suggested procedure?

Regards Hartmut


More information about the cfe-dev mailing list