diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 7 | ||||
-rw-r--r-- | clang/lib/Sema/Sema.h | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index a8cc4049072..7e61bbd14c5 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -114,7 +114,8 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { } Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer) - : PP(pp), Context(ctxt), Consumer(consumer), Diags(PP.getDiagnostics()), + : LangOpts(pp.getLangOptions()), PP(pp), Context(ctxt), Consumer(consumer), + Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), CurContext(0), PreDeclaratorDC(0), CurBlock(0), PackContext(0), IdResolver(pp.getLangOptions()), GlobalNewDeleteDeclared(false) { @@ -197,10 +198,6 @@ void Sema::ActOnEndOfTranslationUnit() { // Helper functions. //===----------------------------------------------------------------------===// -const LangOptions &Sema::getLangOptions() const { - return PP.getLangOptions(); -} - /// getCurFunctionDecl - If inside of a function body, this returns a pointer /// to the function decl for the function being parsed. If we're currently /// in a 'block', this returns the containing context. diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index b574dc360e3..9f1f2a3c318 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -108,6 +108,7 @@ public: /// Sema - This implements semantic analysis and AST building for C. class Sema : public Action { public: + const LangOptions &LangOpts; Preprocessor &PP; ASTContext &Context; ASTConsumer &Consumer; @@ -236,7 +237,7 @@ public: public: Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer); - const LangOptions &getLangOptions() const; + const LangOptions &getLangOptions() const { return LangOpts; } Diagnostic &getDiagnostics() const { return Diags; } SourceManager &getSourceManager() const { return SourceMgr; } |