]> granicus.if.org Git - clang/commitdiff
Write the preprocessor block after we write out types + declarations,
authorDouglas Gregor <dgregor@apple.com>
Sat, 17 Oct 2009 17:25:45 +0000 (17:25 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 17 Oct 2009 17:25:45 +0000 (17:25 +0000)
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84334 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclarationName.cpp
lib/Frontend/PCHWriter.cpp

index 101ddd250933631327b092fb89e50954190c2ef8..4b31617f59a71ad0fb5169f32b45d2aacca06059 100644 (file)
@@ -60,7 +60,7 @@ bool operator<(DeclarationName LHS, DeclarationName RHS) {
 
 DeclarationName::DeclarationName(Selector Sel) {
   if (!Sel.getAsOpaquePtr()) {
-    Ptr = StoredObjCZeroArgSelector;
+    Ptr = 0;
     return;
   }
 
index 73ce4bef345251b16f3ac71041bb1b7ccf747094..a6ee441c869b23e2b34512a6e72a1a8775147c47 100644 (file)
@@ -1063,6 +1063,7 @@ void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
 
   // 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 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
   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 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
   }
   Stream.ExitBlock();
   
+  WritePreprocessor(PP);
   WriteMethodPool(SemaRef);
   WriteIdentifierTable(PP);