friend class ColonProtectionRAIIObject;
friend class InMessageExpressionRAIIObject;
friend class ParenBraceBracketBalancer;
- PrettyStackTraceParserEntry CrashInfo;
Preprocessor &PP;
CompletionConsumer));
// Recover resources if we crash before exiting this method.
- llvm::CrashRecoveryContextCleanupRegistrar
- SemaCleanupInCrash(llvm::CrashRecoveryContextCleanup::
- create<Sema>(S.get()));
+ llvm::CrashRecoveryContextCleanupRegistrar<Sema> CleaupSema(S.get());
ParseAST(*S.get(), PrintStats);
}
ASTConsumer *Consumer = &S.getASTConsumer();
- Parser P(S.getPreprocessor(), S);
+ llvm::OwningPtr<Parser> ParseOP(new Parser(S.getPreprocessor(), S));
+ Parser &P = *ParseOP.get();
+
+ PrettyStackTraceParserEntry CrashInfo(P);
+
+ // Recover resources if we crash before exiting this method.
+ llvm::CrashRecoveryContextCleanupRegistrar<Parser>
+ CleaupParser(ParseOP.get());
+
S.getPreprocessor().EnterMainSourceFile();
P.Initialize();
S.Initialize();
using namespace clang;
Parser::Parser(Preprocessor &pp, Sema &actions)
- : CrashInfo(*this), PP(pp), Actions(actions), Diags(PP.getDiagnostics()),
+ : PP(pp), Actions(actions), Diags(PP.getDiagnostics()),
GreaterThanIsOperator(true), ColonIsSacred(false),
InMessageExpression(false), TemplateParameterDepth(0) {
Tok.setKind(tok::eof);