Changeset 675716e for src/Common
- Timestamp:
- Mar 1, 2019, 3:10:09 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:
- 1cb7fab2
- Parents:
- 8e70823
- Location:
- src/Common
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r8e70823 r675716e 5 5 #include <stack> 6 6 7 #include "Common/Stats.h" 7 8 #include "Common/utility.h" 8 9 … … 426 427 }; 427 428 429 #include "Common/Stats.h" 430 431 extern struct PassVisitorStats { 432 size_t depth = 0; 433 Stats::Counters::MaxCounter<double> * max = nullptr; 434 Stats::Counters::AverageCounter<double> * avg = nullptr; 435 } pass_visitor_stats; 436 428 437 #include "SynTree/TypeSubstitution.h" 429 438 #include "PassVisitor.impl.h" -
src/Common/PassVisitor.impl.h
r8e70823 r675716e 67 67 SemanticErrorException errors; 68 68 69 pass_visitor_stats.depth++; 70 pass_visitor_stats.max->push(pass_visitor_stats.depth); 71 pass_visitor_stats.avg->push(pass_visitor_stats.depth); 69 72 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 73 74 70 75 // splice in new declarations after previous decl 71 76 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } … … 83 88 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 84 89 } 90 pass_visitor_stats.depth--; 85 91 if ( ! errors.isEmpty() ) { 86 92 throw errors; … … 94 100 SemanticErrorException errors; 95 101 102 pass_visitor_stats.depth++; 103 pass_visitor_stats.max->push(pass_visitor_stats.depth); 104 pass_visitor_stats.avg->push(pass_visitor_stats.depth); 96 105 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 97 106 // splice in new declarations after previous decl … … 109 118 if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); } 110 119 } 120 pass_visitor_stats.depth--; 111 121 if ( ! errors.isEmpty() ) { 112 122 throw errors; … … 126 136 if ( ! visitor.get_visit_children() ) return; 127 137 SemanticErrorException errors; 138 139 pass_visitor_stats.depth++; 140 pass_visitor_stats.max->push(pass_visitor_stats.depth); 141 pass_visitor_stats.avg->push(pass_visitor_stats.depth); 128 142 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 129 143 try { … … 135 149 } 136 150 } 151 pass_visitor_stats.depth--; 137 152 if ( ! errors.isEmpty() ) { 138 153 throw errors; … … 153 168 if ( ! mutator.get_visit_children() ) return; 154 169 SemanticErrorException errors; 170 171 pass_visitor_stats.depth++; 172 pass_visitor_stats.max->push(pass_visitor_stats.depth); 173 pass_visitor_stats.avg->push(pass_visitor_stats.depth); 155 174 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 156 175 try { … … 163 182 } // try 164 183 } // for 184 pass_visitor_stats.depth--; 165 185 if ( ! errors.isEmpty() ) { 166 186 throw errors; … … 185 205 DeclList_t* afterDecls = get_afterDecls(); 186 206 207 pass_visitor_stats.depth++; 208 pass_visitor_stats.max->push(pass_visitor_stats.depth); 209 pass_visitor_stats.avg->push(pass_visitor_stats.depth); 187 210 for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) { 188 211 … … 202 225 if ( !empty( beforeStmts ) ) { statements.splice( i, *beforeStmts ); } 203 226 } 227 pass_visitor_stats.depth--; 204 228 205 229 if ( !empty( afterDecls ) ) { splice( std::back_inserter( statements ), afterDecls); } -
src/Common/Stats/Base.h
r8e70823 r675716e 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2019 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // Heap.h -- 8 // 9 // Author : Thierry Delisle 10 // Created On : Fri Mar 03 14:53:53 2019 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 14 // 15 1 16 #pragma once 2 17 -
src/Common/Stats/Counter.cc
r8e70823 r675716e 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Heap.h--7 // Counter.cc -- 8 8 // 9 9 // Author : Thierry Delisle -
src/Common/Stats/Counter.h
r8e70823 r675716e 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Heap.h --7 // Counter.h -- 8 8 // 9 9 // Author : Thierry Delisle -
src/Common/module.mk
r8e70823 r675716e 17 17 SRC_COMMON = \ 18 18 Common/Assert.cc \ 19 Common/Eval.cc \ 20 Common/PassVisitor.cc \ 21 Common/SemanticError.cc \ 19 22 Common/Stats/Heap.cc \ 20 23 Common/Stats/Counter.cc \ 21 Common/Eval.cc \22 Common/SemanticError.cc \23 24 Common/UniqueName.cc 24 25
Note: See TracChangeset
for help on using the changeset viewer.