[cfe-dev] Newby questions

Chris Lattner clattner at apple.com
Thu Sep 6 23:30:22 PDT 2007

On Aug 31, 2007, at 6:33 PM, Hartmut Kaiser wrote:

> Neil Booth 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?
>> I think we should be reading the files in binary mode.
> Ok, this did the trick. If you tell me, how I detect compilation on a
> windows platform in LLVM/clang style (i.e. which pp constant to  
> use) I'll
> submit a patch.

I'm behind and not following closely, did the patch to open files in  
binary mode make it into the tree?

> The errors I've seen were because of the problem above. Now  
> everything I
> checked (especially wrt macro expansion order and macro parameter
> evaluation) looks ok. Good job! There aren't too much preprocessors  
> around
> being able to get all the Wave test cases right (so far, actually  
> besides
> Wave itself there was only 'gcc -E' doing it correctly).

Nice!  We have a bunch of nasty testcases of our own in clang/test/ 
Preprocessor if you're interested.


More information about the cfe-dev mailing list