[cfe-commits] r86071 - /cfe/trunk/tools/clang-cc/clang-cc.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 4 15:41:40 PST 2009
Author: ddunbar
Date: Wed Nov 4 17:41:40 2009
New Revision: 86071
URL: http://llvm.org/viewvc/llvm-project?rev=86071&view=rev
Log:
Turn if chain into switch.
Modified:
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=86071&r1=86070&r2=86071&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Nov 4 17:41:40 2009
@@ -1989,7 +1989,11 @@
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 @@
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 @@
ClearSourceMgr = true;
}
+ }
+
if (FixItRewrite)
FixItRewrite->WriteFixedFile(InFile, OutputFile);
More information about the cfe-commits
mailing list