OLD | NEW |
1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// |
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 /// \file | 10 /// \file |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num }; | 349 enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num }; |
350 | 350 |
351 /// newTimerStackID() creates a new TimerStack in the global space. It does | 351 /// newTimerStackID() creates a new TimerStack in the global space. It does |
352 /// not affect any TimerStack objects in TLS. | 352 /// not affect any TimerStack objects in TLS. |
353 TimerStackIdT newTimerStackID(const std::string &Name); | 353 TimerStackIdT newTimerStackID(const std::string &Name); |
354 /// dumpTimers() dumps the global timer data. This assumes all the | 354 /// dumpTimers() dumps the global timer data. This assumes all the |
355 /// thread-local copies of timer data have been merged into the global timer | 355 /// thread-local copies of timer data have been merged into the global timer |
356 /// data. | 356 /// data. |
357 void dumpTimers(TimerStackIdT StackID = TSK_Default, | 357 void dumpTimers(TimerStackIdT StackID = TSK_Default, |
358 bool DumpCumulative = true); | 358 bool DumpCumulative = true); |
359 /// Merges the current thread's copy of timer data into the global timer data. | 359 void dumpLocalTimers(const std::string &TimerNameOverride, |
360 void mergeTimersFromTLS(); | 360 TimerStackIdT StackID = TSK_Default, |
| 361 bool DumpCumulative = true); |
361 /// The following methods affect only the calling thread's TLS timer data. | 362 /// The following methods affect only the calling thread's TLS timer data. |
362 TimerIdT getTimerID(TimerStackIdT StackID, const std::string &Name); | 363 TimerIdT getTimerID(TimerStackIdT StackID, const std::string &Name); |
363 void pushTimer(TimerIdT ID, TimerStackIdT StackID); | 364 void pushTimer(TimerIdT ID, TimerStackIdT StackID); |
364 void popTimer(TimerIdT ID, TimerStackIdT StackID); | 365 void popTimer(TimerIdT ID, TimerStackIdT StackID); |
365 void resetTimer(TimerStackIdT StackID); | 366 void resetTimer(TimerStackIdT StackID); |
| 367 std::string getTimerName(TimerStackIdT StackID); |
366 void setTimerName(TimerStackIdT StackID, const std::string &NewName); | 368 void setTimerName(TimerStackIdT StackID, const std::string &NewName); |
367 | 369 |
368 /// This is the first work item sequence number that the parser produces, and | 370 /// This is the first work item sequence number that the parser produces, and |
369 /// correspondingly the first sequence number that the emitter thread will | 371 /// correspondingly the first sequence number that the emitter thread will |
370 /// wait for. Start numbering at 1 to leave room for a sentinel, in case e.g. | 372 /// wait for. Start numbering at 1 to leave room for a sentinel, in case e.g. |
371 /// we wish to inject items with a special sequence number that may be | 373 /// we wish to inject items with a special sequence number that may be |
372 /// executed out of order. | 374 /// executed out of order. |
373 static constexpr uint32_t getFirstSequenceNumber() { return 1; } | 375 static constexpr uint32_t getFirstSequenceNumber() { return 1; } |
374 /// Adds a newly parsed and constructed function to the Cfg work queue. | 376 /// Adds a newly parsed and constructed function to the Cfg work queue. |
375 /// Notifies any idle workers that a new function is available for | 377 /// Notifies any idle workers that a new function is available for |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 678 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
677 ~OstreamLocker() { Ctx->unlockStr(); } | 679 ~OstreamLocker() { Ctx->unlockStr(); } |
678 | 680 |
679 private: | 681 private: |
680 GlobalContext *const Ctx; | 682 GlobalContext *const Ctx; |
681 }; | 683 }; |
682 | 684 |
683 } // end of namespace Ice | 685 } // end of namespace Ice |
684 | 686 |
685 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 687 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
OLD | NEW |