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

Unified Diff: src/IceTranslator.cpp

Issue 848193003: Subzero: Add locking to prepare for multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 11 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 | « src/IceTranslator.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTranslator.cpp
diff --git a/src/IceTranslator.cpp b/src/IceTranslator.cpp
index 2a50a410c90a0db122a87e32ca846d51b5df8d30..c0331a8718df28fe05546d2812995340e76db6ca 100644
--- a/src/IceTranslator.cpp
+++ b/src/IceTranslator.cpp
@@ -50,14 +50,15 @@ IceString Translator::createUnnamedName(const IceString &Prefix, SizeT Index) {
}
bool Translator::checkIfUnnamedNameSafe(const IceString &Name, const char *Kind,
- const IceString &Prefix,
- Ostream &Stream) {
+ const IceString &Prefix) {
if (Name.find(Prefix) == 0) {
for (size_t i = Prefix.size(); i < Name.size(); ++i) {
if (!isdigit(Name[i])) {
return false;
}
}
+ OstreamLocker L(Ctx);
+ Ostream &Stream = Ctx->getStrDump();
Stream << "Warning : Default " << Kind << " prefix '" << Prefix
<< "' potentially conflicts with name '" << Name << "'.\n";
return true;
@@ -108,6 +109,7 @@ void Translator::lowerGlobals(
bool DisableTranslation = Ctx->getFlags().DisableTranslation;
const bool DumpGlobalVariables =
ALLOW_DUMP && Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty();
+ OstreamLocker L(Ctx);
Ostream &Stream = Ctx->getStrDump();
const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly;
for (const Ice::VariableDeclaration *Global : VariableDeclarations) {
« no previous file with comments | « src/IceTranslator.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698