]> granicus.if.org Git - clang/commitdiff
dgregor should write code that compiles.
authorJohn McCall <rjmccall@apple.com>
Thu, 12 Aug 2010 21:23:27 +0000 (21:23 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 12 Aug 2010 21:23:27 +0000 (21:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110956 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/ParseAST.cpp
lib/Sema/Sema.cpp

index 099171e56fbbeb07079c7965ab5373b0391d63ce..c0208c7bbd1d4deecfee31ce38d7e47f474e8668 100644 (file)
@@ -67,6 +67,8 @@ void clang::ParseAST(Sema &S, bool PrintStats) {
     Stmt::CollectingStats(true);
   }
 
+  ASTConsumer *Consumer = &S.getASTConsumer();
+
   Parser P(S.getPreprocessor(), S);
   S.getPreprocessor().EnterMainSourceFile();
   
@@ -93,15 +95,15 @@ void clang::ParseAST(Sema &S, bool PrintStats) {
     Consumer->HandleTopLevelDecl(DeclGroupRef(*I));
   
   // Dump record layouts, if requested.
-  if (PP.getLangOptions().DumpRecordLayouts)
-    DumpRecordLayouts(Ctx);
+  if (S.getLangOptions().DumpRecordLayouts)
+    DumpRecordLayouts(S.getASTContext());
   
-  Consumer->HandleTranslationUnit(Ctx);
+  Consumer->HandleTranslationUnit(S.getASTContext());
   
   if (PrintStats) {
     fprintf(stderr, "\nSTATISTICS:\n");
     P.getActions().PrintStats();
-    Ctx.PrintStats();
+    S.getASTContext().PrintStats();
     Decl::PrintStats();
     Stmt::PrintStats();
     Consumer->PrintStats();
index a504ae69a2c60e187fd6a8db844adf243151c9a8..21ad1636177a3634aa8913e52c92d85c57bee49d 100644 (file)
@@ -18,7 +18,7 @@
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/APFloat.h"
 #include "clang/Sema/ExternalSemaSource.h"
-#include "clang/AST/ASTConsumer.h"
+#include "clang/Sema/SemaConsumer.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTDiagnostic.h"
 #include "clang/AST/DeclObjC.h"
@@ -145,7 +145,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
                   ExpressionEvaluationContextRecord(PotentiallyEvaluated, 0));
   
   // Tell the AST consumer about this Sema object.
-  Consumer.Initialize(this);
+  Consumer.Initialize(Context);
   
   // FIXME: Isn't this redundant with the initialization above?
   if (SemaConsumer *SC = dyn_cast<SemaConsumer>(&Consumer))
@@ -154,7 +154,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
   // Tell the external Sema source about this Sema object.
   if (ExternalSemaSource *ExternalSema
         = dyn_cast_or_null<ExternalSemaSource>(Context.getExternalSource()))
-    ExternalSema->InitializeSema(S)
+    ExternalSema->InitializeSema(*this);
 }
 
 Sema::~Sema() {