[cfe-commits] r84334 - in /cfe/trunk/lib: AST/DeclarationName.cpp Frontend/PCHWriter.cpp

Douglas Gregor dgregor at apple.com
Sat Oct 17 10:25:47 PDT 2009


Author: dgregor
Date: Sat Oct 17 12:25:45 2009
New Revision: 84334

URL: http://llvm.org/viewvc/llvm-project?rev=84334&view=rev
Log:
Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types. 

Also, properly store a NULL selector.

Modified:
    cfe/trunk/lib/AST/DeclarationName.cpp
    cfe/trunk/lib/Frontend/PCHWriter.cpp

Modified: cfe/trunk/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=84334&r1=84333&r2=84334&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)
+++ cfe/trunk/lib/AST/DeclarationName.cpp Sat Oct 17 12:25:45 2009
@@ -60,7 +60,7 @@
 
 DeclarationName::DeclarationName(Selector Sel) {
   if (!Sel.getAsOpaquePtr()) {
-    Ptr = StoredObjCZeroArgSelector;
+    Ptr = 0;
     return;
   }
 

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=84334&r1=84333&r2=84334&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Sat Oct 17 12:25:45 2009
@@ -1063,6 +1063,7 @@
 
   // Loop over all the macro definitions that are live at the end of the file,
   // emitting each to the PP section.
+  // FIXME: Make sure that this sees macros defined in included PCH files.
   for (Preprocessor::macro_iterator I = PP.macro_begin(), E = PP.macro_end();
        I != E; ++I) {
     // FIXME: This emits macros in hash table order, we should do it in a stable
@@ -1886,7 +1887,6 @@
   if (StatCalls && !isysroot)
     WriteStatCache(*StatCalls, isysroot);
   WriteSourceManagerBlock(Context.getSourceManager(), PP, isysroot);
-  WritePreprocessor(PP);
   WriteComments(Context);
   // Write the record of special types.
   Record.clear();
@@ -1919,6 +1919,7 @@
   }
   Stream.ExitBlock();
   
+  WritePreprocessor(PP);
   WriteMethodPool(SemaRef);
   WriteIdentifierTable(PP);
 





More information about the cfe-commits mailing list