Make a significant change to invert the control flow handling
predefined macros. Previously, these were handled by the driver, now they are handled by the preprocessor. Some fallout of this: 1. Instead of preprocessing two buffers (the predefines, then the main source file) we now start preprocessing the main source file and inject the predefines as a "psuedo #include" from the main source file. 2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify Preprocessor::isInPrimaryFile. 3. The driver doesn't have to know about standard #defines, the preprocessor knows, which is nice for people wanting to define their own drivers. 4. This allows us to put normal tokens in the predefine buffer, for example a definition for __builtin_va_list that is target-specific, and a typedef for id in objc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42818 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- Driver/DiagChecker.cpp 1 addition, 1 deletionDriver/DiagChecker.cpp
- Driver/PrintPreprocessedOutput.cpp 1 addition, 1 deletionDriver/PrintPreprocessedOutput.cpp
- Driver/clang.cpp 48 additions, 136 deletionsDriver/clang.cpp
- Lex/Lexer.cpp 0 additions, 1 deletionLex/Lexer.cpp
- Lex/Preprocessor.cpp 131 additions, 7 deletionsLex/Preprocessor.cpp
- Sema/ASTStreamer.cpp 1 addition, 1 deletionSema/ASTStreamer.cpp
- include/clang/Lex/Lexer.h 0 additions, 11 deletionsinclude/clang/Lex/Lexer.h
- include/clang/Lex/Preprocessor.h 18 additions, 7 deletionsinclude/clang/Lex/Preprocessor.h
Loading
Please register or sign in to comment