OLD | NEW |
1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// | 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines aspects of the compilation that persist across | 10 // This file defines aspects of the compilation that persist across |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 Timers[StackID].reset(); | 432 Timers[StackID].reset(); |
433 } | 433 } |
434 | 434 |
435 void GlobalContext::setTimerName(TimerStackIdT StackID, | 435 void GlobalContext::setTimerName(TimerStackIdT StackID, |
436 const IceString &NewName) { | 436 const IceString &NewName) { |
437 assert(StackID < Timers.size()); | 437 assert(StackID < Timers.size()); |
438 Timers[StackID].setName(NewName); | 438 Timers[StackID].setName(NewName); |
439 } | 439 } |
440 | 440 |
441 void GlobalContext::dumpStats(const IceString &Name, bool Final) { | 441 void GlobalContext::dumpStats(const IceString &Name, bool Final) { |
| 442 if (!ALLOW_DUMP) |
| 443 return; |
442 if (Flags.DumpStats) { | 444 if (Flags.DumpStats) { |
443 if (Final) { | 445 if (Final) { |
444 StatsCumulative.dump(Name, getStrDump()); | 446 StatsCumulative.dump(Name, getStrDump()); |
445 } else { | 447 } else { |
446 StatsFunction.dump(Name, getStrDump()); | 448 StatsFunction.dump(Name, getStrDump()); |
447 StatsCumulative.dump("_TOTAL_", getStrDump()); | 449 StatsCumulative.dump("_TOTAL_", getStrDump()); |
448 } | 450 } |
449 } | 451 } |
450 } | 452 } |
451 | 453 |
452 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) { | 454 void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) { |
| 455 if (!ALLOW_DUMP) |
| 456 return; |
453 assert(Timers.size() > StackID); | 457 assert(Timers.size() > StackID); |
454 Timers[StackID].dump(getStrDump(), DumpCumulative); | 458 Timers[StackID].dump(getStrDump(), DumpCumulative); |
455 } | 459 } |
456 | 460 |
457 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) | 461 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) |
458 : ID(ID), Ctx(Func->getContext()), | 462 : ID(ID), Ctx(Func->getContext()), |
459 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) { | 463 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) { |
460 if (Active) | 464 if (Active) |
461 Ctx->pushTimer(ID); | 465 Ctx->pushTimer(ID); |
462 } | 466 } |
463 | 467 |
464 } // end of namespace Ice | 468 } // end of namespace Ice |
OLD | NEW |