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

Unified Diff: src/IceGlobalContext.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: 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
Index: src/IceGlobalContext.h
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index 9264d4302fbc0d6990e4261c399630ea1fafab39..8154e002c4e5aedaba25296bdde7860d8a94e8f8 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -145,14 +145,19 @@ class GlobalContext {
};
public:
+ // The dump stream is a log stream while emit is the stream code
+ // is emitted to. The error stream is strictly for logging errors.
+ // If an error stream is not provided, the dump stream will be
+ // used instead.
GlobalContext(Ostream *OsDump, Ostream *OsEmit, ELFStreamer *ELFStreamer,
- const ClFlags &Flags);
+ const ClFlags &Flags, Ostream *OsError = nullptr);
~GlobalContext();
- // The dump and emit streams need to be used by only one thread at a
- // time. This is done by exclusively reserving the streams via
- // lockStr() and unlockStr(). The OstreamLocker class can be used
- // to conveniently manage this.
+ //
+ // The dump, error, and emit streams need to be used by only one
+ // thread at a time. This is done by exclusively reserving the
+ // streams via lockStr() and unlockStr(). The OstreamLocker class
+ // can be used to conveniently manage this.
//
// The model is that a thread grabs the stream lock, then does an
// arbitrary amount of work during which far-away callees may grab
@@ -163,6 +168,7 @@ public:
void lockStr() { StrLock.lock(); }
void unlockStr() { StrLock.unlock(); }
Ostream &getStrDump() { return *StrDump; }
+ Ostream &getStrError() { return StrError ? *StrError : *StrDump; }
Ostream &getStrEmit() { return *StrEmit; }
LockedPtr<ErrorCode> getErrorStatus() {
@@ -418,6 +424,7 @@ private:
StrLockType StrLock;
Ostream *StrDump; // Stream for dumping / diagnostics
Ostream *StrEmit; // Stream for code emission
+ Ostream *StrError; // If non-null, stream for logging errors.
ICE_CACHELINE_BOUNDARY;

Powered by Google App Engine
This is Rietveld 408576698