Chromium Code Reviews| Index: tools/pnacl-freeze/pnacl-freeze.cpp |
| diff --git a/tools/pnacl-freeze/pnacl-freeze.cpp b/tools/pnacl-freeze/pnacl-freeze.cpp |
| index 963000a714a5063d224e00bc328348bcd343eba1..297edb85a70ee2f67d8251d4088c47e0fe679631 100644 |
| --- a/tools/pnacl-freeze/pnacl-freeze.cpp |
| +++ b/tools/pnacl-freeze/pnacl-freeze.cpp |
| @@ -31,19 +31,16 @@ using namespace llvm; |
| static cl::opt<std::string> |
| OutputFilename("o", cl::desc("Specify output 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("<pexe file>"), cl::Required); |
| +InputFilename(cl::Positional, cl::desc("<pexe file>"), cl::init("-")); |
| static void WriteOutputFile(const Module *M) { |
| - std::string FrozenFilename = |
| - (OutputFilename.size() == 0 ? (InputFilename + ".frozen") : OutputFilename); |
| - |
| std::string ErrorInfo; |
| OwningPtr<tool_output_file> Out |
| - (new tool_output_file(FrozenFilename.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(getStreamedBitcodeModule(DisplayFilename, streamer, Context, |
| &ErrorMessage)); |
| if(M.get() != 0 && M->MaterializeAllPermanently(&ErrorMessage)) { |