Changeset 4f97937
- Timestamp:
- Mar 4, 2019, 3:52:46 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 79eaeb7
- Parents:
- 1bb9a9a
- Location:
- src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Stats/Base.h
r1bb9a9a r4f97937 16 16 #pragma once 17 17 18 #include <cstdint> 19 #include <iostream> 20 18 21 namespace Stats { 19 22 namespace Base { … … 28 31 29 32 template<typename func_t> 30 void ForAll(TreeTop & range, s ize_t level, func_t func, bool destroy = false);33 void ForAll(TreeTop & range, std::size_t level, func_t func, bool destroy = false); 31 34 32 35 class TreeImpl { … … 46 49 47 50 template<typename func_t> 48 friend void ForAll(TreeTop & range, s ize_t level, func_t func, bool destroy);51 friend void ForAll(TreeTop & range, std::size_t level, func_t func, bool destroy); 49 52 }; 50 53 … … 56 59 57 60 template<typename func_t> 58 inline void ForAll(TreeTop & range, s ize_t level, func_t func, bool destroy) {61 inline void ForAll(TreeTop & range, std::size_t level, func_t func, bool destroy) { 59 62 auto it = range.head; 60 63 while(it) { -
src/Common/Stats/Stats.cc
r1bb9a9a r4f97937 32 32 namespace Time { 33 33 bool enabled = false; 34 void print() {}34 void print(); 35 35 } 36 36 -
src/Common/Stats/Time.h
r1bb9a9a r4f97937 18 18 #include "Common/Stats/Base.h" 19 19 20 #if defined( NO_STATISTICS ) 21 #define NO_TIME_STATISTICS 22 #endif 23 20 24 namespace Stats { 21 25 namespace Time { 22 void StartBlock(const char * const name); 23 void StopBlock(); 26 # if defined(NO_TIME_STATISTICS) 27 inline void StartBlock(const char * const) {} 28 inline void StopBlock() {} 24 29 25 void print();30 inline void print() {} 26 31 27 struct BlockGuard {28 BlockGuard(const char * const name ) { StartBlock(name);}29 ~BlockGuard() { StopBlock();}30 };32 struct BlockGuard { 33 BlockGuard(const char * const) {} 34 ~BlockGuard() {} 35 }; 31 36 32 template<typename func_t> 33 void TimeBLock(const char * name, func_t func) { 34 BlockGuard guard(name); 35 func(); 36 } 37 template<typename func_t> 38 inline void TimeBLock(const char *, func_t) {} 39 # else 40 void StartBlock(const char * const name); 41 void StopBlock(); 42 43 void print(); 44 45 struct BlockGuard { 46 BlockGuard(const char * const name ) { StartBlock(name); } 47 ~BlockGuard() { StopBlock(); } 48 }; 49 50 template<typename func_t> 51 inline void TimeBLock(const char * name, func_t func) { 52 BlockGuard guard(name); 53 func(); 54 } 55 # endif 37 56 } 38 57 } -
src/Common/module.mk
r1bb9a9a r4f97937 23 23 Common/Stats/Heap.cc \ 24 24 Common/Stats/Stats.cc \ 25 Common/Stats/Time.cc \ 25 26 Common/UniqueName.cc 26 27 -
src/Makefile.in
r1bb9a9a r4f97937 168 168 Common/PassVisitor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ 169 169 Common/Stats/Counter.$(OBJEXT) Common/Stats/Heap.$(OBJEXT) \ 170 Common/Stats/Stats.$(OBJEXT) Common/UniqueName.$(OBJEXT) 170 Common/Stats/Stats.$(OBJEXT) Common/Stats/Time.$(OBJEXT) \ 171 Common/UniqueName.$(OBJEXT) 171 172 am__objects_3 = ControlStruct/ForExprMutator.$(OBJEXT) \ 172 173 ControlStruct/LabelFixer.$(OBJEXT) \ … … 567 568 Common/Stats/Heap.cc \ 568 569 Common/Stats/Stats.cc \ 570 Common/Stats/Time.cc \ 569 571 Common/UniqueName.cc 570 572 … … 741 743 Common/Stats/$(DEPDIR)/$(am__dirstamp) 742 744 Common/Stats/Stats.$(OBJEXT): Common/Stats/$(am__dirstamp) \ 745 Common/Stats/$(DEPDIR)/$(am__dirstamp) 746 Common/Stats/Time.$(OBJEXT): Common/Stats/$(am__dirstamp) \ 743 747 Common/Stats/$(DEPDIR)/$(am__dirstamp) 744 748 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ … … 1128 1132 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Heap.Po@am__quote@ 1129 1133 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Stats.Po@am__quote@ 1134 @AMDEP_TRUE@@am__include@ @am__quote@Common/Stats/$(DEPDIR)/Time.Po@am__quote@ 1130 1135 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@ 1131 1136 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@ -
src/main.cc
r1bb9a9a r4f97937 79 79 if ( errorp ) { cerr << name << endl; } \ 80 80 NewPass(name); \ 81 pass; 81 Stats::Time::StartBlock(name); \ 82 pass; \ 83 Stats::Time::StopBlock(); 82 84 83 85 LinkageSpec::Spec linkage = LinkageSpec::Cforall;
Note: See TracChangeset
for help on using the changeset viewer.