diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-22 19:21:44 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-22 19:21:44 +0000 |
| commit | 4da04a4e82c6d4083b8b532baf1db9892b89e8f8 (patch) | |
| tree | ced561ef09dbe41ce37085795d70c8fb962f75a4 /clang/lib/Sema | |
| parent | e5ea41b5c4f06f7b152f166d00455982abe85c5f (diff) | |
| download | bcm5719-llvm-4da04a4e82c6d4083b8b532baf1db9892b89e8f8.tar.gz bcm5719-llvm-4da04a4e82c6d4083b8b532baf1db9892b89e8f8.zip | |
inline Sema::getLangOptions, rdar://6515190. This speeds up
fsyntax-only with PTH by 3%.
llvm-svn: 62774
Diffstat (limited to 'clang/lib/Sema')
| -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; } |

