Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    rd08beee rebcc940  
    3737#include "CodeTools/TrackLoc.h"             // for fillLocations
    3838#include "Common/CompilerError.h"           // for CompilerError
    39 #include "Common/Heap.h"
     39#include "Common/Stats.h"
    4040#include "Common/PassVisitor.h"
    4141#include "Common/SemanticError.h"           // for SemanticError
     
    6767#define PASS(name, pass)                   \
    6868        if ( errorp ) { cerr << name << endl; } \
    69         HeapStats::newPass(name);               \
     69        Stats::Heap::newPass(name);               \
    7070        pass;
    7171
     
    377377
    378378        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
    380384        return 0;
    381385} // main
    382386
    383387void 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, Symbol, 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};
    385389
    386390        static struct option long_opts[] = {
     
    402406                { "resolver", no_argument, 0, Resolver },
    403407                { "resolv-proto", no_argument, 0, ResolvProto },
     408                { "stats", required_argument, 0, Stats },
    404409                { "symbol", no_argument, 0, Symbol },
    405410                { "tree", no_argument, 0, Tree },
     
    489494                  case 'R':                                                                             // dump resolv-proto instance
    490495                        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                        }
    491516                        break;
    492517                  case Symbol:
Note: See TracChangeset for help on using the changeset viewer.