| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 ErrorCodes getReturnValue(const Ice::ClFlagsExtra &Flags, ErrorCodes Val) { | 90 ErrorCodes getReturnValue(const Ice::ClFlagsExtra &Flags, ErrorCodes Val) { |
| 91 if (Flags.getAlwaysExitSuccess()) | 91 if (Flags.getAlwaysExitSuccess()) |
| 92 return EC_None; | 92 return EC_None; |
| 93 return Val; | 93 return Val; |
| 94 } | 94 } |
| 95 | 95 |
| 96 // Reports fatal error message, and then exits with success status 0. | 96 // Reports fatal error message, and then exits with success status 0. |
| 97 void reportFatalErrorThenExitSuccess(void * UserData, | 97 void reportFatalErrorThenExitSuccess(void *UserData, const std::string &Reason, |
| 98 const std::string &Reason, | |
| 99 bool GenCrashDag) { | 98 bool GenCrashDag) { |
| 100 (void)UserData; | 99 (void)UserData; |
| 101 (void)GenCrashDag; | 100 (void)GenCrashDag; |
| 102 | 101 |
| 103 // Note: This code is (mostly) copied from llvm/lib/Support/ErrorHandling.cpp | 102 // Note: This code is (mostly) copied from llvm/lib/Support/ErrorHandling.cpp |
| 104 | 103 |
| 105 // Blast the result out to stderr. We don't try hard to make sure this | 104 // Blast the result out to stderr. We don't try hard to make sure this |
| 106 // succeeds (e.g. handling EINTR) and we can't use errs() here because | 105 // succeeds (e.g. handling EINTR) and we can't use errs() here because |
| 107 // raw ostreams can call report_fatal_error. | 106 // raw ostreams can call report_fatal_error. |
| 108 llvm::SmallVector<char, 64> Buffer; | 107 llvm::SmallVector<char, 64> Buffer; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 }); | 199 }); |
| 201 CompileThread.join(); | 200 CompileThread.join(); |
| 202 } else { | 201 } else { |
| 203 getCompiler().run(ExtraFlags, *Ctx.get(), std::move(InputStream)); | 202 getCompiler().run(ExtraFlags, *Ctx.get(), std::move(InputStream)); |
| 204 } | 203 } |
| 205 transferErrorCode(getReturnValue( | 204 transferErrorCode(getReturnValue( |
| 206 ExtraFlags, static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); | 205 ExtraFlags, static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); |
| 207 } | 206 } |
| 208 | 207 |
| 209 } // end of namespace Ice | 208 } // end of namespace Ice |
| OLD | NEW |