Changeset 0633cf2 for src/main.cc
- Timestamp:
- Feb 28, 2019, 5:13:47 PM (5 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:
- 0050a5f
- Parents:
- 5509ff4 (diff), 79de2210 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r5509ff4 r0633cf2 37 37 #include "CodeTools/TrackLoc.h" // for fillLocations 38 38 #include "Common/CompilerError.h" // for CompilerError 39 #include "Common/ Heap.h"39 #include "Common/Stats.h" 40 40 #include "Common/PassVisitor.h" 41 41 #include "Common/SemanticError.h" // for SemanticError … … 67 67 #define PASS(name, pass) \ 68 68 if ( errorp ) { cerr << name << endl; } \ 69 HeapStats::newPass(name); \69 Stats::Heap::newPass(name); \ 70 70 pass; 71 71 … … 377 377 378 378 deleteAll( translationUnit ); 379 if(!libcfap && !treep) HeapStats::printStats(); 379 if(!libcfap && !treep) { 380 if(stats_counters) Stats::Counters::print(); 381 if(stats_heap) Stats::Heap::print(); 382 } 383 380 384 return 0; 381 385 } // main 382 386 383 387 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 384 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, S ymbol, Tree, TupleExpansion, Validate,};388 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, Stats, Symbol, Tree, TupleExpansion, Validate}; 385 389 386 390 static struct option long_opts[] = { … … 402 406 { "resolver", no_argument, 0, Resolver }, 403 407 { "resolv-proto", no_argument, 0, ResolvProto }, 408 { "stats", required_argument, 0, Stats }, 404 409 { "symbol", no_argument, 0, Symbol }, 405 410 { "tree", no_argument, 0, Tree }, … … 489 494 case 'R': // dump resolv-proto instance 490 495 resolvprotop = true; 496 break; 497 case Stats: 498 { 499 std::stringstream ss(optarg); 500 while(ss.good()) { 501 std::string substr; 502 getline( ss, substr, ',' ); 503 if(substr == "counters") { 504 stats_counters = true; 505 } else if(substr == "heap") { 506 stats_heap = true; 507 } else if(substr == "none") { 508 stats_counters = false; 509 stats_heap = false; 510 } else { 511 std::cerr << "Ignoring unknown statistic " << substr << std::endl; 512 } 513 } 514 515 } 491 516 break; 492 517 case Symbol:
Note: See TracChangeset
for help on using the changeset viewer.