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

Unified Diff: src/IceBrowserCompileServer.h

Issue 1052833003: First attempt to capture parser/translation errors in browser. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits and syntax errors. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceBrowserCompileServer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceBrowserCompileServer.h
diff --git a/src/IceBrowserCompileServer.h b/src/IceBrowserCompileServer.h
index 1ef8121ab1b1cd3a46283498f18a65d00262a80a..a34a03d150755499cb08e38796cc973bb91dfda1 100644
--- a/src/IceBrowserCompileServer.h
+++ b/src/IceBrowserCompileServer.h
@@ -39,6 +39,7 @@ class BrowserCompileServer : public CompileServer {
BrowserCompileServer() = delete;
BrowserCompileServer(const BrowserCompileServer &) = delete;
BrowserCompileServer &operator=(const BrowserCompileServer &) = delete;
+ class StringStream;
public:
explicit BrowserCompileServer(Compiler &Comp)
@@ -74,7 +75,20 @@ public:
ELFStream.reset(nullptr);
}
+ StringStream &getErrorStream() {
+ return *ErrorStream;
+ }
+
private:
+ class StringStream {
+ public:
+ StringStream() : StrBuf(Buffer) {}
+ const IceString &getContents() { return StrBuf.str(); }
+ Ostream &getStream() { return StrBuf; }
+ private:
+ std::string Buffer;
+ llvm::raw_string_ostream StrBuf;
+ };
// This currently only handles a single compile request, hence one copy
// of the state.
std::unique_ptr<GlobalContext> Ctx;
@@ -84,6 +98,7 @@ private:
llvm::QueueStreamer *InputStream;
std::unique_ptr<Ostream> LogStream;
std::unique_ptr<llvm::raw_fd_ostream> EmitStream;
+ std::unique_ptr<StringStream> ErrorStream;
std::unique_ptr<ELFStreamer> ELFStream;
ClFlags Flags;
ClFlagsExtra ExtraFlags;
« no previous file with comments | « no previous file | src/IceBrowserCompileServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698