Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: src/IceBrowserCompileServer.h

Issue 1838753002: Subzero: Remove IceString. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceAssemblerARM32.cpp ('k') | src/IceBrowserCompileServer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 LastError.assign(Ctx->getErrorStatus()->value()); 70 LastError.assign(Ctx->getErrorStatus()->value());
71 // Reset some state. The InputStream is deleted by the compiler so only 71 // Reset some state. The InputStream is deleted by the compiler so only
72 // reset this to nullptr. Free and flush the rest of the streams. 72 // reset this to nullptr. Free and flush the rest of the streams.
73 InputStream = nullptr; 73 InputStream = nullptr;
74 EmitStream.reset(nullptr); 74 EmitStream.reset(nullptr);
75 ELFStream.reset(nullptr); 75 ELFStream.reset(nullptr);
76 } 76 }
77 77
78 StringStream &getErrorStream() { return *ErrorStream; } 78 StringStream &getErrorStream() { return *ErrorStream; }
79 79
80 void setFatalError(const IceString &Reason); 80 void setFatalError(const std::string &Reason);
81 81
82 private: 82 private:
83 class StringStream { 83 class StringStream {
84 public: 84 public:
85 StringStream() : StrBuf(Buffer) {} 85 StringStream() : StrBuf(Buffer) {}
86 const IceString &getContents() { return StrBuf.str(); } 86 const std::string &getContents() { return StrBuf.str(); }
87 Ostream &getStream() { return StrBuf; } 87 Ostream &getStream() { return StrBuf; }
88 88
89 private: 89 private:
90 std::string Buffer; 90 std::string Buffer;
91 llvm::raw_string_ostream StrBuf; 91 llvm::raw_string_ostream StrBuf;
92 }; 92 };
93 /// This currently only handles a single compile request, hence one copy of 93 /// This currently only handles a single compile request, hence one copy of
94 /// the state. 94 /// the state.
95 std::unique_ptr<GlobalContext> Ctx; 95 std::unique_ptr<GlobalContext> Ctx;
96 /// A borrowed reference to the current InputStream. The compiler owns the 96 /// A borrowed reference to the current InputStream. The compiler owns the
97 /// actual reference so the server must be careful not to access after the 97 /// actual reference so the server must be careful not to access after the
98 /// compiler is done. 98 /// compiler is done.
99 llvm::QueueStreamer *InputStream = nullptr; 99 llvm::QueueStreamer *InputStream = nullptr;
100 std::unique_ptr<Ostream> LogStream; 100 std::unique_ptr<Ostream> LogStream;
101 std::unique_ptr<llvm::raw_fd_ostream> EmitStream; 101 std::unique_ptr<llvm::raw_fd_ostream> EmitStream;
102 std::unique_ptr<StringStream> ErrorStream; 102 std::unique_ptr<StringStream> ErrorStream;
103 std::unique_ptr<ELFStreamer> ELFStream; 103 std::unique_ptr<ELFStreamer> ELFStream;
104 ClFlags *Flags; 104 ClFlags *Flags;
105 std::thread CompileThread; 105 std::thread CompileThread;
106 std::atomic<bool> HadError; 106 std::atomic<bool> HadError;
107 }; 107 };
108 108
109 } // end of namespace Ice 109 } // end of namespace Ice
110 110
111 #endif // SUBZERO_SRC_ICEBROWSERCOMPILESERVER_H 111 #endif // SUBZERO_SRC_ICEBROWSERCOMPILESERVER_H
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.cpp ('k') | src/IceBrowserCompileServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698