| OLD | NEW |
| 1 //===- subzero/src/IceBrowserCompileServer.h - Browser server ---*- C++ -*-===// | 1 //===- subzero/src/IceBrowserCompileServer.h - Browser server ---*- C++ -*-===// |
| 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 24 matching lines...) Expand all Loading... |
| 35 /// version, this version gets compile requests over IPC. Each compile request | 35 /// version, this version gets compile requests over IPC. Each compile request |
| 36 /// will have a slimmed down version of argc, argv while other flags are set to | 36 /// will have a slimmed down version of argc, argv while other flags are set to |
| 37 /// defaults that make sense in the browser case. The output file is specified | 37 /// defaults that make sense in the browser case. The output file is specified |
| 38 /// via a posix FD, and input bytes are pushed to the server. | 38 /// via a posix FD, and input bytes are pushed to the server. |
| 39 class BrowserCompileServer : public CompileServer { | 39 class BrowserCompileServer : public CompileServer { |
| 40 BrowserCompileServer(const BrowserCompileServer &) = delete; | 40 BrowserCompileServer(const BrowserCompileServer &) = delete; |
| 41 BrowserCompileServer &operator=(const BrowserCompileServer &) = delete; | 41 BrowserCompileServer &operator=(const BrowserCompileServer &) = delete; |
| 42 class StringStream; | 42 class StringStream; |
| 43 | 43 |
| 44 public: | 44 public: |
| 45 BrowserCompileServer() : HadError(false) {} | 45 BrowserCompileServer() |
| 46 : Flags(&GlobalContext::Flags), ExtraFlags(&GlobalContext::ExtraFlags), |
| 47 HadError(false) {} |
| 46 | 48 |
| 47 ~BrowserCompileServer() final; | 49 ~BrowserCompileServer() final; |
| 48 | 50 |
| 49 void run() final; | 51 void run() final; |
| 50 | 52 |
| 51 ErrorCode &getErrorCode() final; | 53 ErrorCode &getErrorCode() final; |
| 52 | 54 |
| 53 /// Parse and set up the flags for compile jobs. | 55 /// Parse and set up the flags for compile jobs. |
| 54 void getParsedFlags(uint32_t NumThreads, int argc, char **argv); | 56 void getParsedFlags(uint32_t NumThreads, int argc, char **argv); |
| 55 | 57 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 /// the state. | 97 /// the state. |
| 96 std::unique_ptr<GlobalContext> Ctx; | 98 std::unique_ptr<GlobalContext> Ctx; |
| 97 /// A borrowed reference to the current InputStream. The compiler owns the | 99 /// A borrowed reference to the current InputStream. The compiler owns the |
| 98 /// actual reference so the server must be careful not to access after the | 100 /// actual reference so the server must be careful not to access after the |
| 99 /// compiler is done. | 101 /// compiler is done. |
| 100 llvm::QueueStreamer *InputStream = nullptr; | 102 llvm::QueueStreamer *InputStream = nullptr; |
| 101 std::unique_ptr<Ostream> LogStream; | 103 std::unique_ptr<Ostream> LogStream; |
| 102 std::unique_ptr<llvm::raw_fd_ostream> EmitStream; | 104 std::unique_ptr<llvm::raw_fd_ostream> EmitStream; |
| 103 std::unique_ptr<StringStream> ErrorStream; | 105 std::unique_ptr<StringStream> ErrorStream; |
| 104 std::unique_ptr<ELFStreamer> ELFStream; | 106 std::unique_ptr<ELFStreamer> ELFStream; |
| 105 ClFlags Flags; | 107 ClFlags *Flags; |
| 106 ClFlagsExtra ExtraFlags; | 108 ClFlagsExtra *ExtraFlags; |
| 107 std::thread CompileThread; | 109 std::thread CompileThread; |
| 108 std::atomic<bool> HadError; | 110 std::atomic<bool> HadError; |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 } // end of namespace Ice | 113 } // end of namespace Ice |
| 112 | 114 |
| 113 #endif // SUBZERO_SRC_ICEBROWSERCOMPILESERVER_H | 115 #endif // SUBZERO_SRC_ICEBROWSERCOMPILESERVER_H |
| OLD | NEW |