diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-10 22:13:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-10 22:13:17 +0000 |
commit | 531cc8355608295caa01f31fa4e078d77a3d6470 (patch) | |
tree | 69b4b699385ee42bf842f3ce4a6f2f9d8feffd8e /lib/Frontend/PCHReader.cpp | |
parent | 47892828490da215fc2be630ea13d40706c3ae66 (diff) |
do a dance with predefines, and finally enable reading of macros from
PCH. This works now, except for limitations not being able to do things
with identifiers. The basic example in the testcase works though.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index d5923086c7..eaba610137 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -271,11 +271,7 @@ bool PCHReader::ReadPreprocessorBlock() { } // Finally, install the macro. - II = II; -#if 0 - // FIXME: Do this when predefines buffer is worked out. PP.setMacroInfo(II, MI); -#endif // Remember that we saw this macro last so that we add the tokens that // form its body to it. @@ -466,6 +462,12 @@ bool PCHReader::ReadPCH(const std::string &FileName) { // Load the translation unit declaration ReadDeclRecord(DeclOffsets[0], 0); + // If everything looks like it will be ok, then the PCH file load succeeded. + // Since the PCH file contains everything that is in the preprocessor's + // predefines buffer (and we validated that they are the same) clear out the + // predefines buffer so that it doesn't get processed again. + PP.setPredefines(""); + return false; } |