[cfe-commits] r62774 - in /cfe/trunk/lib/Sema: Sema.cpp Sema.h
Chris Lattner
sabre at nondot.org
Thu Jan 22 11:21:46 PST 2009
Author: lattner
Date: Thu Jan 22 13:21:44 2009
New Revision: 62774
URL: http://llvm.org/viewvc/llvm-project?rev=62774&view=rev
Log:
inline Sema::getLangOptions, rdar://6515190. This speeds up
fsyntax-only with PTH by 3%.
Modified:
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/lib/Sema/Sema.h
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=62774&r1=62773&r2=62774&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Thu Jan 22 13:21:44 2009
@@ -114,7 +114,8 @@
}
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 @@
// 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.
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=62774&r1=62773&r2=62774&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Jan 22 13:21:44 2009
@@ -108,6 +108,7 @@
/// 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:
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; }
More information about the cfe-commits
mailing list