}
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) {
// 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.
/// Sema - This implements semantic analysis and AST building for C.
class Sema : public Action {
public:
+ const LangOptions &LangOpts;
Preprocessor &PP;
ASTContext &Context;
ASTConsumer &Consumer;
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; }