summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-10 22:13:17 +0000
committerChris Lattner <sabre@nondot.org>2009-04-10 22:13:17 +0000
commitd959d753bc84c298aa9982752fc3335766b30b19 (patch)
treebc8fb9e7da216088ca562788a180aebe0faaba56 /clang/lib/Frontend/PCHReader.cpp
parente49adaf7f26509c0c5267e7a461b98f35ec78050 (diff)
downloadbcm5719-llvm-d959d753bc84c298aa9982752fc3335766b30b19.tar.gz
bcm5719-llvm-d959d753bc84c298aa9982752fc3335766b30b19.zip
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. llvm-svn: 68832
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index d5923086c7a..eaba610137d 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud