diff options
Diffstat (limited to 'lib/Parse/ParseAST.cpp')
-rw-r--r-- | lib/Parse/ParseAST.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Parse/ParseAST.cpp b/lib/Parse/ParseAST.cpp index 236689184d..d1c2624f8c 100644 --- a/lib/Parse/ParseAST.cpp +++ b/lib/Parse/ParseAST.cpp @@ -38,19 +38,20 @@ using namespace clang; void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, ASTContext &Ctx, bool PrintStats, TranslationUnitKind TUKind, - CodeCompleteConsumer *CompletionConsumer) { + CodeCompleteConsumer *CompletionConsumer, + bool SkipFunctionBodies) { OwningPtr<Sema> S(new Sema(PP, Ctx, *Consumer, TUKind, CompletionConsumer)); // Recover resources if we crash before exiting this method. - llvm::CrashRecoveryContextCleanupRegistrar<Sema> CleaupSema(S.get()); + llvm::CrashRecoveryContextCleanupRegistrar<Sema> CleanupSema(S.get()); - ParseAST(*S.get(), PrintStats); + ParseAST(*S.get(), PrintStats, SkipFunctionBodies); } -void clang::ParseAST(Sema &S, bool PrintStats) { +void clang::ParseAST(Sema &S, bool PrintStats, bool SkipFunctionBodies) { // Collect global stats on Decls/Stmts (until we have a module streamer). if (PrintStats) { Decl::EnableStatistics(); @@ -63,14 +64,15 @@ void clang::ParseAST(Sema &S, bool PrintStats) { ASTConsumer *Consumer = &S.getASTConsumer(); - OwningPtr<Parser> ParseOP(new Parser(S.getPreprocessor(), S)); + OwningPtr<Parser> ParseOP(new Parser(S.getPreprocessor(), S, + SkipFunctionBodies)); Parser &P = *ParseOP.get(); PrettyStackTraceParserEntry CrashInfo(P); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<Parser> - CleaupParser(ParseOP.get()); + CleanupParser(ParseOP.get()); S.getPreprocessor().EnterMainSourceFile(); P.Initialize(); |