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
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index d592308..eaba610 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -271,11 +271,7 @@
       }
 
       // 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 @@
   // 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;
 }