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

Unified Diff: src/PNaClTranslator.cpp

Issue 1845913003: Clean up Cl flag refrences in the bitcode parser. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 65b8a5c8ae7e277fd4dcd925971a58dcf416e1a9..0bba5c27ef78222d983084fa7dc2bafa3632346e 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -446,6 +446,10 @@ private:
// Defines if a module block has already been parsed.
bool ParsedModuleBlock = false;
+ static const Ice::ClFlags &getFlags() {
+ return Ice::GlobalContext::getFlags();
+ }
+
bool ParseBlock(unsigned BlockID) override;
// Gets extended type associated with the given index, assuming the extended
@@ -489,8 +493,7 @@ private:
// Installs names for global variables without names.
void installGlobalVarNames() {
assert(VariableDeclarations);
- const std::string &GlobalPrefix =
- getTranslator().getFlags().getDefaultGlobalPrefix();
+ const std::string &GlobalPrefix = getFlags().getDefaultGlobalPrefix();
if (!GlobalPrefix.empty()) {
NaClBcIndexSize_t NameIndex = 0;
for (Ice::VariableDeclaration *Var : *VariableDeclarations) {
@@ -501,8 +504,7 @@ private:
// Installs names for functions without names.
void installFunctionNames() {
- const std::string &FunctionPrefix =
- getTranslator().getFlags().getDefaultFunctionPrefix();
+ const std::string &FunctionPrefix = getFlags().getDefaultFunctionPrefix();
if (!FunctionPrefix.empty()) {
NaClBcIndexSize_t NameIndex = 0;
for (Ice::FunctionDeclaration *Func : FunctionDeclarations) {
@@ -588,8 +590,7 @@ bool TopLevelParser::ErrorAt(naclbitc::ErrorLevel Level, uint64_t Bit,
NaClBitcodeParser::ErrorAt(Level, Bit, Message);
setErrStream(OldErrStream);
}
- if (Level >= naclbitc::Error &&
- !Translator.getFlags().getAllowErrorRecovery())
+ if (Level >= naclbitc::Error && !getFlags().getAllowErrorRecovery())
Fatal();
return true;
}
@@ -693,7 +694,9 @@ protected:
// Gets the translator associated with the bitcode parser.
Ice::Translator &getTranslator() const { return Context->getTranslator(); }
- const Ice::ClFlags &getFlags() const { return getTranslator().getFlags(); }
+ static const Ice::ClFlags &getFlags() {
+ return Ice::GlobalContext::getFlags();
+ }
// Default implementation. Reports that block is unknown and skips its
// contents.
@@ -3176,7 +3179,7 @@ bool ModuleParser::ParseBlock(unsigned BlockID) {
std::unique_ptr<Ice::Cfg> Func = Parser.parseFunction(SeqNumber);
bool Failed = Func->hasError();
getTranslator().translateFcn(std::move(Func));
- return Failed && !getTranslator().getFlags().getAllowErrorRecovery();
+ return Failed && !getFlags().getAllowErrorRecovery();
}
}
default:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698