OLD | NEW |
1 //===- subzero/src/IceCompileServer.cpp - Compile server ------------------===// | 1 //===- subzero/src/IceCompileServer.cpp - Compile server ------------------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 for (size_t i = 0; i < Len; ++i) | 82 for (size_t i = 0; i < Len; ++i) |
83 Buf[i] = BitcodeBuffer[Cursor + i]; | 83 Buf[i] = BitcodeBuffer[Cursor + i]; |
84 Cursor += Len; | 84 Cursor += Len; |
85 return Len; | 85 return Len; |
86 } | 86 } |
87 | 87 |
88 std::unique_ptr<Ostream> makeStream(const std::string &Filename, | 88 std::unique_ptr<Ostream> makeStream(const std::string &Filename, |
89 std::error_code &EC) { | 89 std::error_code &EC) { |
90 if (Filename == "-") { | 90 if (Filename == "-") { |
91 return std::unique_ptr<Ostream>(new llvm::raw_os_ostream(std::cout)); | 91 return std::unique_ptr<Ostream>(new llvm::raw_os_ostream(std::cout)); |
| 92 } else if (Filename == "/dev/stderr") { |
| 93 return std::unique_ptr<Ostream>(new llvm::raw_os_ostream(std::cerr)); |
92 } else { | 94 } else { |
93 return std::unique_ptr<Ostream>( | 95 return std::unique_ptr<Ostream>( |
94 new llvm::raw_fd_ostream(Filename, EC, llvm::sys::fs::F_None)); | 96 new llvm::raw_fd_ostream(Filename, EC, llvm::sys::fs::F_None)); |
95 } | 97 } |
96 } | 98 } |
97 | 99 |
98 ErrorCodes getReturnValue(ErrorCodes Val) { | 100 ErrorCodes getReturnValue(ErrorCodes Val) { |
99 if (getFlags().getAlwaysExitSuccess()) | 101 if (getFlags().getAlwaysExitSuccess()) |
100 return EC_None; | 102 return EC_None; |
101 return Val; | 103 return Val; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } else { | 240 } else { |
239 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); | 241 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); |
240 } | 242 } |
241 transferErrorCode( | 243 transferErrorCode( |
242 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); | 244 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); |
243 Ctx->dumpConstantLookupCounts(); | 245 Ctx->dumpConstantLookupCounts(); |
244 Ctx->dumpStrings(); | 246 Ctx->dumpStrings(); |
245 } | 247 } |
246 | 248 |
247 } // end of namespace Ice | 249 } // end of namespace Ice |
OLD | NEW |