diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-10 14:41:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-10 14:41:33 +0000 |
commit | b592fc2b8dc5701999704c14e228a98233d20a03 (patch) | |
tree | b30dd542efcb8a3956fd8c04ca15f5b8133fc8c1 /tools | |
parent | a2706518f9cc34358cba1072f78235aa091d6d93 (diff) | |
download | external_llvm-b592fc2b8dc5701999704c14e228a98233d20a03.zip external_llvm-b592fc2b8dc5701999704c14e228a98233d20a03.tar.gz external_llvm-b592fc2b8dc5701999704c14e228a98233d20a03.tar.bz2 |
Make 'opt -o -' work correctly instead of creating a file named './-'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/opt/opt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 30c72f1..d032e24 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -44,7 +44,7 @@ InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-")); 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 @@ int main(int argc, char **argv) { // 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 |