Deleted Added
full compact
21d20
< #include "llvm/Support/Streams.h"
25a25
> #include "llvm/Support/raw_ostream.h"
40,41d39
< #include <fstream>
< #include <ios>
130c128
< SrcMgr.PrintMessage(ErrorLoc, Msg);
---
> SrcMgr.PrintMessage(ErrorLoc, Msg, "error");
143c141,142
< cerr << "Could not open input file '" + Filename + "': " << ErrorStr <<"\n";
---
> errs() << "Could not open input file '" + Filename + "': "
> << ErrorStr <<"\n";
169c168
< std::ostream *Out = cout.stream();
---
> raw_ostream *Out = &outs();
171c170,171
< Out = new std::ofstream(OutputFilename.c_str());
---
> std::string Error;
> Out = new raw_fd_ostream(OutputFilename.c_str(), false, Error);
173,174c173,175
< if (!Out->good()) {
< cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
---
> if (!Error.empty()) {
> errs() << argv[0] << ": error opening " << OutputFilename
> << ":" << Error << "\n";
249c250
< if (Out != cout.stream())
---
> if (Out != &outs())
254c255
< cerr << argv[0] << ": error:\n";
---
> errs() << argv[0] << ": error:\n";
258c259
< cerr << argv[0] << ": " << Error << "\n";
---
> errs() << argv[0] << ": " << Error << "\n";
260c261
< cerr << argv[0] << ": " << Error << "\n";
---
> errs() << argv[0] << ": " << Error << "\n";
262c263
< cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
---
> errs() << argv[0] << ": Unknown unexpected exception occurred.\n";
265c266
< if (Out != cout.stream()) {
---
> if (Out != &outs()) {