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

Unified Diff: src/IceCfg.cpp

Issue 1855683002: Subzero: Fix -timing-funcs and -timing-focus flags. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase 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 | src/IceClFlags.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index e5a71aa49866104f9674bb1d762a2ddf89c83803..2d16734eab18b9cea1761e5705670314bff69451 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -197,14 +197,18 @@ void Cfg::addCallToProfileSummary() {
void Cfg::translate() {
if (hasError())
return;
- if (BuildDefs::dump()) {
+ if (BuildDefs::timers()) {
const std::string TimingFocusOn = getFlags().getTimingFocusOn();
- const std::string Name = getFunctionName().toString();
- if (TimingFocusOn == "*" || TimingFocusOn == Name) {
- setFocusedTiming();
- getContext()->resetTimer(GlobalContext::TSK_Default);
- getContext()->setTimerName(GlobalContext::TSK_Default, Name);
+ if (!TimingFocusOn.empty()) {
+ const std::string Name = getFunctionName().toString();
+ if (TimingFocusOn == "*" || TimingFocusOn == Name) {
+ setFocusedTiming();
+ getContext()->resetTimer(GlobalContext::TSK_Default);
+ getContext()->setTimerName(GlobalContext::TSK_Default, Name);
+ }
}
+ }
+ if (BuildDefs::dump()) {
if (isVerbose(IceV_Status)) {
getContext()->getStrDump() << ">>>Translating "
<< getFunctionNameAndSize() << "\n";
@@ -235,8 +239,10 @@ void Cfg::translate() {
getTarget()->translate();
dump("Final output");
- if (getFocusedTiming())
+ if (getFocusedTiming()) {
+ getContext()->mergeTimersFromTLS();
getContext()->dumpTimers();
+ }
}
void Cfg::computeInOutEdges() {
« no previous file with comments | « no previous file | src/IceClFlags.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698