[llvm-commits] CVS: llvm/tools/opt/opt.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Dec 10 08:42:01 PST 2003
Changes in directory llvm/tools/opt:
opt.cpp updated: 1.86 -> 1.87
---
Log message:
Make 'opt -o -' work correctly instead of creating a file named './-'
---
Diffs of the changes: (+2 -2)
Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.86 llvm/tools/opt/opt.cpp:1.87
--- llvm/tools/opt/opt.cpp:1.86 Tue Nov 11 16:41:34 2003
+++ llvm/tools/opt/opt.cpp Wed Dec 10 08:41:33 2003
@@ -44,7 +44,7 @@
static cl::opt<std::string>
OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
+ cl::value_desc("filename"), cl::init("-"));
static cl::opt<bool>
Force("f", cl::desc("Overwrite output files"));
@@ -93,7 +93,7 @@
// Figure out what stream we are supposed to write to...
std::ostream *Out = &std::cout; // Default to printing to stdout...
- if (OutputFilename != "") {
+ if (OutputFilename != "-") {
if (!Force && std::ifstream(OutputFilename.c_str())) {
// If force is not specified, make sure not to overwrite a file!
std::cerr << argv[0] << ": error opening '" << OutputFilename
More information about the llvm-commits
mailing list