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/IceGlobalContext.cpp

Issue 1848303003: Simplify references to command line flags. (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 | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index bacaec390541720bebf904425d9e2c8472f9bfa3..5689a3ec3ea50c7ca8d7340fce8a4801c2c56896 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -293,13 +293,13 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError,
ELFStreamer *ELFStr)
: Strings(new StringPool()), ConstPool(new ConstantPool()), ErrorStatus(),
StrDump(OsDump), StrEmit(OsEmit), StrError(OsError), IntrinsicsInfo(this),
- ObjectWriter(),
- OptQ(/*Sequential=*/Flags.isSequential(),
- /*MaxSize=*/
- Flags.isParseParallel() ? MaxOptQSize
- : Flags.getNumTranslationThreads()),
+ ObjectWriter(), OptQ(/*Sequential=*/getFlags().isSequential(),
+ /*MaxSize=*/
+ getFlags().isParseParallel()
+ ? MaxOptQSize
+ : getFlags().getNumTranslationThreads()),
// EmitQ is allowed unlimited size.
- EmitQ(/*Sequential=*/Flags.isSequential()),
+ EmitQ(/*Sequential=*/getFlags().isSequential()),
DataLowering(TargetDataLowering::createLowering(this)) {
assert(OsDump && "OsDump is not defined for GlobalContext");
assert(OsEmit && "OsEmit is not defined for GlobalContext");
@@ -325,7 +325,7 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError,
newTimerStackID("Per-function summary");
}
Timers.initInto(MyTLS->Timers);
- switch (Flags.getOutFileType()) {
+ switch (getFlags().getOutFileType()) {
case FT_Elf:
ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr));
break;
@@ -455,9 +455,9 @@ void GlobalContext::saveBlockInfoPtrs() {
void GlobalContext::lowerGlobals(const std::string &SectionSuffix) {
TimerMarker T(TimerStack::TT_emitGlobalInitializers, this);
- const bool DumpGlobalVariables = BuildDefs::dump() &&
- (Flags.getVerbose() & IceV_GlobalInit) &&
- Flags.getVerboseFocusOn().empty();
+ const bool DumpGlobalVariables =
+ BuildDefs::dump() && (getFlags().getVerbose() & IceV_GlobalInit) &&
+ getFlags().getVerboseFocusOn().empty();
if (DumpGlobalVariables) {
OstreamLocker L(this);
Ostream &Stream = getStrDump();
@@ -465,7 +465,7 @@ void GlobalContext::lowerGlobals(const std::string &SectionSuffix) {
Global->dump(Stream);
}
}
- if (Flags.getDisableTranslation())
+ if (getFlags().getDisableTranslation())
return;
saveBlockInfoPtrs();
@@ -679,8 +679,8 @@ void GlobalContext::dumpStrings() {
void GlobalContext::dumpConstantLookupCounts() {
if (!BuildDefs::dump())
return;
- const bool DumpCounts = (Flags.getVerbose() & IceV_ConstPoolStats) &&
- Flags.getVerboseFocusOn().empty();
+ const bool DumpCounts = (getFlags().getVerbose() & IceV_ConstPoolStats) &&
+ getFlags().getVerboseFocusOn().empty();
if (!DumpCounts)
return;
@@ -980,13 +980,11 @@ GlobalStringPoolTraits::getStrings(const GlobalContext *PoolOwner) {
return PoolOwner->getStrings();
}
-ClFlags GlobalContext::Flags;
-
TimerIdT TimerMarker::getTimerIdFromFuncName(GlobalContext *Ctx,
const std::string &FuncName) {
if (!BuildDefs::timers())
return 0;
- if (!Ctx->getFlags().getTimeEachFunction())
+ if (!getFlags().getTimeEachFunction())
return 0;
return Ctx->getTimerID(GlobalContext::TSK_Funcs, FuncName);
}
@@ -994,10 +992,10 @@ TimerIdT TimerMarker::getTimerIdFromFuncName(GlobalContext *Ctx,
void TimerMarker::push() {
switch (StackID) {
case GlobalContext::TSK_Default:
- Active = Ctx->getFlags().getSubzeroTimingEnabled();
+ Active = getFlags().getSubzeroTimingEnabled();
break;
case GlobalContext::TSK_Funcs:
- Active = Ctx->getFlags().getTimeEachFunction();
+ Active = getFlags().getTimeEachFunction();
break;
default:
break;
@@ -1008,8 +1006,7 @@ void TimerMarker::push() {
void TimerMarker::pushCfg(const Cfg *Func) {
Ctx = Func->getContext();
- Active =
- Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled();
+ Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled();
if (Active)
Ctx->pushTimer(ID, StackID);
}
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698