Changeset 3c0d4cd
- Timestamp:
- Mar 5, 2019, 2:17:45 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:
- c884f2d
- Parents:
- 79eaeb7
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Stats/Time.cc
r79eaeb7 r3c0d4cd 33 33 typedef std::chrono::time_point<std::chrono::high_resolution_clock> point_t; 34 34 std::chrono::duration<double> total; 35 std::chrono::duration<double> parent;36 35 37 36 point_t global_begin; 37 38 size_t prevl = 0; 39 size_t currl = 0; 38 40 39 41 template<typename T> … … 85 87 86 88 virtual void print(std::ostream & os) override { 89 if(currl > prevl) { 90 parents.push(last); 91 } else if(currl < prevl) { 92 parents.pop(); 93 } else { 94 last = end - begin; 95 } 96 87 97 assert(finished); 88 98 std::chrono::duration<double> diff = end - begin; 89 99 os << diff << " | "; 90 os << std::setw(7) << std::setprecision(0); 91 os << size_t(100.0 * diff.count() / total.count()) << "% | "; 100 if(parents.empty()) { 101 os << " N/A | "; 102 } else { 103 os << std::setw(7) << std::setprecision(0); 104 os << size_t(100.0 * diff.count() / parents.top().count()) << "% | "; 105 } 92 106 os << std::setw(5) << std::setprecision(0); 93 107 os << size_t(100.0 * diff.count() / total.count()) << "% "; … … 111 125 point_t begin; 112 126 point_t end; 127 128 static std::chrono::duration<double> last; 129 static std::stack<std::chrono::duration<double>> parents; 113 130 }; 114 131 115 132 std::stack<TimerNode *> nodes; 133 134 std::chrono::duration<double> TimerNode::last = {}; 135 std::stack<std::chrono::duration<double>> TimerNode::parents = {}; 116 136 117 137 void StartGlobal() { … … 139 159 auto global_end = std::chrono::high_resolution_clock::now(); 140 160 total = global_end - global_begin; 141 parent = total;142 161 143 162 size_t nc = 0; … … 161 180 162 181 Base::ForAll(top, 0, [&](Base::TreeImpl * node, size_t level) { 182 currl = level; 163 183 std::cerr << std::string(level * 4, ' '); 164 184 std::cerr << node->name; … … 168 188 std::cerr << " |"; 169 189 std::cerr << '\n'; 190 prevl = level; 170 191 }, true); 171 192 -
src/SymTab/Validate.cc
r79eaeb7 r3c0d4cd 304 304 PassVisitor<FixQualifiedTypes> fixQual; 305 305 306 Stats::Heap::newPass("validate-A"); 307 acceptAll( translationUnit, hoistDecls ); 308 ReplaceTypedef::replaceTypedef( translationUnit ); 309 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen 310 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling 311 Stats::Heap::newPass("validate-B"); 312 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 313 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed 314 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 315 EliminateTypedef::eliminateTypedef( translationUnit ); // 316 Stats::Heap::newPass("validate-C"); 317 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 318 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors 319 ReturnChecker::checkFunctionReturns( translationUnit ); 320 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 321 Stats::Heap::newPass("validate-D"); 322 Concurrency::applyKeywords( translationUnit ); 323 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 324 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 325 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 326 Stats::Heap::newPass("validate-E"); 327 Concurrency::implementMutexFuncs( translationUnit ); 328 Concurrency::implementThreadStarter( translationUnit ); 329 mutateAll( translationUnit, compoundliteral ); 330 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 331 Stats::Heap::newPass("validate-F"); 332 FixObjectType::fix( translationUnit ); 333 ArrayLength::computeLength( translationUnit ); 334 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 335 mutateAll( translationUnit, labelAddrFixer ); 336 Validate::handleAttributes( translationUnit ); 306 { 307 Stats::Heap::newPass("validate-A"); 308 Stats::Time::BlockGuard guard("validate-A"); 309 acceptAll( translationUnit, hoistDecls ); 310 ReplaceTypedef::replaceTypedef( translationUnit ); 311 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen 312 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling 313 } 314 { 315 Stats::Heap::newPass("validate-B"); 316 Stats::Time::BlockGuard guard("validate-B"); 317 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 318 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed 319 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 320 EliminateTypedef::eliminateTypedef( translationUnit ); // 321 } 322 { 323 Stats::Heap::newPass("validate-C"); 324 Stats::Time::BlockGuard guard("validate-C"); 325 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 326 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors 327 ReturnChecker::checkFunctionReturns( translationUnit ); 328 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 329 } 330 { 331 Stats::Heap::newPass("validate-D"); 332 Stats::Time::BlockGuard guard("validate-D"); 333 Concurrency::applyKeywords( translationUnit ); 334 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 335 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 336 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 337 } 338 { 339 Stats::Heap::newPass("validate-E"); 340 Stats::Time::BlockGuard guard("validate-E"); 341 Concurrency::implementMutexFuncs( translationUnit ); 342 Concurrency::implementThreadStarter( translationUnit ); 343 mutateAll( translationUnit, compoundliteral ); 344 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 345 } 346 { 347 Stats::Heap::newPass("validate-F"); 348 Stats::Time::BlockGuard guard("validate-F"); 349 FixObjectType::fix( translationUnit ); 350 ArrayLength::computeLength( translationUnit ); 351 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 352 mutateAll( translationUnit, labelAddrFixer ); 353 Validate::handleAttributes( translationUnit ); 354 } 337 355 } 338 356 -
src/main.cc
r79eaeb7 r3c0d4cd 194 194 } // if 195 195 196 Stats::Time::StartGlobal(); 196 197 NewPass("Parse"); 197 Stats::Time::Start Global();198 Stats::Time::StartBlock("Parse"); 198 199 199 200 // read in the builtins, extras, and the prelude … … 247 248 // works okay for now. 248 249 CodeTools::fillLocations( translationUnit ); 250 Stats::Time::StopBlock(); 249 251 250 252 // add the assignment statement after the initialization of a type parameter
Note: See TracChangeset
for help on using the changeset viewer.