@@ -30,19 +30,16 @@ using namespace llvm;
30
30
31
31
static cl::opt<std::string>
32
32
OutputFilename (" o" , cl::desc(" Specify thawed pexe filename" ),
33
- cl::value_desc(" filename" ));
33
+ cl::value_desc(" filename" ), cl::init( " - " ) );
34
34
35
35
static cl::opt<std::string>
36
- InputFilename (cl::Positional, cl::desc(" <frozen file>" ), cl::Required );
36
+ InputFilename (cl::Positional, cl::desc(" <frozen file>" ), cl::init( " - " ) );
37
37
38
38
static void WriteOutputFile (const Module *M) {
39
39
40
- std::string ThawedFilename =
41
- (OutputFilename.size () == 0 ? (InputFilename + " .thawed" ) : OutputFilename);
42
-
43
40
std::string ErrorInfo;
44
41
OwningPtr<tool_output_file> Out
45
- (new tool_output_file (ThawedFilename .c_str (), ErrorInfo,
42
+ (new tool_output_file (OutputFilename .c_str (), ErrorInfo,
46
43
raw_fd_ostream::F_Binary));
47
44
if (!ErrorInfo.empty ()) {
48
45
errs () << ErrorInfo << ' \n ' ;
@@ -72,7 +69,11 @@ int main(int argc, char **argv) {
72
69
// Use the bitcode streaming interface
73
70
DataStreamer *streamer = getDataFileStreamer (InputFilename, &ErrorMessage);
74
71
if (streamer) {
75
- std::string DisplayFilename = InputFilename;
72
+ std::string DisplayFilename;
73
+ if (InputFilename == " -" )
74
+ DisplayFilename = " <stdin>" ;
75
+ else
76
+ DisplayFilename = InputFilename;
76
77
M.reset (getNaClStreamedBitcodeModule (DisplayFilename, streamer, Context,
77
78
&ErrorMessage));
78
79
if (M.get () != 0 && M->MaterializeAllPermanently (&ErrorMessage)) {
0 commit comments