From c0c7bca4e5b8d12699dc93a0da49e9e4bb79671b Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Sun, 21 Mar 2010 10:50:08 +0000 Subject: Update clang to r99115. --- lib/Frontend/FrontendActions.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'lib/Frontend/FrontendActions.cpp') diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index 1e210b42e6d1..251b8e4cb738 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -22,6 +22,18 @@ #include "llvm/Support/raw_ostream.h" using namespace clang; +//===----------------------------------------------------------------------===// +// Custom Actions +//===----------------------------------------------------------------------===// + +ASTConsumer *InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, + llvm::StringRef InFile) { + return new ASTConsumer(); +} + +void InitOnlyAction::ExecuteAction() { +} + //===----------------------------------------------------------------------===// // AST Consumer Actions //===----------------------------------------------------------------------===// @@ -185,7 +197,8 @@ void DumpTokensAction::ExecuteAction() { Preprocessor &PP = getCompilerInstance().getPreprocessor(); // Start preprocessing the specified input file. Token Tok; - PP.EnterMainSourceFile(); + if (PP.EnterMainSourceFile()) + return; do { PP.Lex(Tok); PP.DumpToken(Tok, true); @@ -213,7 +226,8 @@ void ParseOnlyAction::ExecuteAction() { llvm::OwningPtr PA(new MinimalAction(PP)); Parser P(PP, *PA); - PP.EnterMainSourceFile(); + if (PP.EnterMainSourceFile()) + return; P.ParseTranslationUnit(); } @@ -222,7 +236,8 @@ void PreprocessOnlyAction::ExecuteAction() { Token Tok; // Start parsing the specified input file. - PP.EnterMainSourceFile(); + if (PP.EnterMainSourceFile()) + return; do { PP.Lex(Tok); } while (Tok.isNot(tok::eof)); @@ -237,7 +252,8 @@ void PrintParseAction::ExecuteAction() { llvm::OwningPtr PA(CreatePrintParserActionsAction(PP, OS)); Parser P(PP, *PA); - PP.EnterMainSourceFile(); + if (PP.EnterMainSourceFile()) + return; P.ParseTranslationUnit(); } -- cgit v1.2.3