aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-04 23:41:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-04 23:41:40 +0000
commit593c41fb0bc6dd556401440c63754e28b93d803b (patch)
tree3f5258ceef7a76845b253a769ff8483b41e79c29
parent3926a1fe92f622f194d7d99560d0b17b2af65a61 (diff)
Turn if chain into switch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86071 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/clang-cc/clang-cc.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 95f6370401..2c0c7021d5 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -1989,7 +1989,11 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
CreateCodeCompleter, CreateCodeCompleterData);
}
- if (PA == RunPreprocessorOnly) { // Just lex as fast as we can, no output.
+ // Perform post processing actions and actions which don't use a consumer.
+ switch (PA) {
+ default: break;
+
+ case RunPreprocessorOnly: { // Just lex as fast as we can, no output.
llvm::TimeRegion Timer(ClangFrontendTimer);
Token Tok;
// Start parsing the specified input file.
@@ -1998,11 +2002,17 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
PP.Lex(Tok);
} while (Tok.isNot(tok::eof));
ClearSourceMgr = true;
- } else if (PA == ParseNoop) { // -parse-noop
+ break;
+ }
+
+ case ParseNoop: {
llvm::TimeRegion Timer(ClangFrontendTimer);
ParseFile(PP, new MinimalAction(PP));
ClearSourceMgr = true;
- } else if (PA == PrintPreprocessedInput){ // -E mode.
+ break;
+ }
+
+ case PrintPreprocessedInput: {
llvm::TimeRegion Timer(ClangFrontendTimer);
if (DumpMacros)
DoPrintMacros(PP, OS.get());
@@ -2013,6 +2023,8 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
ClearSourceMgr = true;
}
+ }
+
if (FixItRewrite)
FixItRewrite->WriteFixedFile(InFile, OutputFile);