[cfe-commits] r87102 - /cfe/trunk/tools/clang-cc/clang-cc.cpp
Daniel Dunbar
daniel at zuster.org
Fri Nov 13 02:19:00 PST 2009
Author: ddunbar
Date: Fri Nov 13 04:18:59 2009
New Revision: 87102
URL: http://llvm.org/viewvc/llvm-project?rev=87102&view=rev
Log:
clang-cc: Move output file initialization closer to use.
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=87102&r1=87101&r2=87102&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Fri Nov 13 04:18:59 2009
@@ -426,24 +426,12 @@
case DumpTokens:
case RunPreprocessorOnly:
case ParseNoop:
- break; // No setup.
-
case GeneratePTH:
- if (FEOpts.OutputFile.empty() || FEOpts.OutputFile == "-") {
- // FIXME: Don't fail this way.
- // FIXME: Verify that we can actually seek in the given file.
- llvm::errs() << "ERROR: PTH requires an seekable file for output!\n";
- ::exit(1);
- }
- OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
- break;
-
case PrintPreprocessedInput:
case ParsePrintCallbacks:
case RewriteMacros:
case RewriteTest:
- OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
- break;
+ break; // No setup.
}
// Check if we want a fix-it rewriter.
@@ -531,6 +519,13 @@
}
case GeneratePTH:
+ if (FEOpts.OutputFile.empty() || FEOpts.OutputFile == "-") {
+ // FIXME: Don't fail this way.
+ // FIXME: Verify that we can actually seek in the given file.
+ llvm::errs() << "ERROR: PTH requires an seekable file for output!\n";
+ ::exit(1);
+ }
+ OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
CacheTokens(PP, static_cast<llvm::raw_fd_ostream*>(OS.get()));
break;
@@ -539,18 +534,22 @@
break;
case ParsePrintCallbacks:
+ OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
ParseFile(PP, CreatePrintParserActionsAction(PP, OS.get()));
break;
case PrintPreprocessedInput:
+ OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
DoPrintPreprocessedInput(PP, OS.get(), CI.getPreprocessorOutputOpts());
break;
case RewriteMacros:
+ OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
RewriteMacrosInInput(PP, OS.get());
break;
case RewriteTest:
+ OS.reset(ComputeOutFile(CI.getFrontendOpts(), InFile, 0, true, OutPath));
DoRewriteTest(PP, OS.get());
break;
More information about the cfe-commits
mailing list