aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/ParseAST.cpp10
-rw-r--r--lib/Sema/Sema.cpp6
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp
index 099171e56f..c0208c7bbd 100644
--- a/lib/Sema/ParseAST.cpp
+++ b/lib/Sema/ParseAST.cpp
@@ -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();
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index a504ae69a2..21ad163617 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -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() {