]> granicus.if.org Git - clang/commitdiff
inline Sema::getLangOptions, rdar://6515190. This speeds up
authorChris Lattner <sabre@nondot.org>
Thu, 22 Jan 2009 19:21:44 +0000 (19:21 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 22 Jan 2009 19:21:44 +0000 (19:21 +0000)
fsyntax-only with PTH by 3%.

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

lib/Sema/Sema.cpp
lib/Sema/Sema.h

index a8cc40490725d40a4eb4a9a1f1fdccf91f502093..7e61bbd14c5f86c913190a533f17e08a7139b122 100644 (file)
@@ -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.
index b574dc360e3ff5da676d0386cdd67c34f653cb84..9f1f2a3c3189ed3380c7056eb17b0a4beb7aae26 100644 (file)
@@ -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; }