Chromium Code Reviews| Index: tools/pnacl-thaw/pnacl-thaw.cpp |
| diff --git a/tools/pnacl-thaw/pnacl-thaw.cpp b/tools/pnacl-thaw/pnacl-thaw.cpp |
| index b28c357165779af6ec11dd6e5e19cb225e8b7f31..3060e7c07337e0e987aa9e52be43ebc9ec6d7136 100644 |
| --- a/tools/pnacl-thaw/pnacl-thaw.cpp |
| +++ b/tools/pnacl-thaw/pnacl-thaw.cpp |
| @@ -30,19 +30,16 @@ using namespace llvm; |
| static cl::opt<std::string> |
| OutputFilename("o", cl::desc("Specify thawed pexe filename"), |
| - cl::value_desc("filename")); |
| + cl::value_desc("filename"), cl::init("-")); |
|
jvoung (off chromium)
2013/05/06 18:48:54
tab?
Karl
2013/05/06 20:13:06
Done.
|
| static cl::opt<std::string> |
| -InputFilename(cl::Positional, cl::desc("<frozen file>"), cl::Required); |
| +InputFilename(cl::Positional, cl::desc("<frozen file>"), cl::init("-")); |
| static void WriteOutputFile(const Module *M) { |
| - std::string ThawedFilename = |
| - (OutputFilename.size() == 0 ? (InputFilename + ".thawed") : OutputFilename); |
| - |
| std::string ErrorInfo; |
| OwningPtr<tool_output_file> Out |
| - (new tool_output_file(ThawedFilename.c_str(), ErrorInfo, |
| + (new tool_output_file(OutputFilename.c_str(), ErrorInfo, |
| raw_fd_ostream::F_Binary)); |
| if (!ErrorInfo.empty()) { |
| errs() << ErrorInfo << '\n'; |
| @@ -72,7 +69,11 @@ int main(int argc, char **argv) { |
| // Use the bitcode streaming interface |
| DataStreamer *streamer = getDataFileStreamer(InputFilename, &ErrorMessage); |
| if (streamer) { |
| - std::string DisplayFilename = InputFilename; |
| + std::string DisplayFilename; |
| + if (InputFilename == "-") |
| + DisplayFilename = "<stdin>"; |
| + else |
| + DisplayFilename = InputFilename; |
| M.reset(getNaClStreamedBitcodeModule(DisplayFilename, streamer, Context, |
| &ErrorMessage)); |
| if(M.get() != 0 && M->MaterializeAllPermanently(&ErrorMessage)) { |