Changeset 6137fbb


Ignore:
Timestamp:
Oct 19, 2017, 11:13:11 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
bd7e609
Parents:
0a22cda
git-author:
Rob Schluntz <rschlunt@…> (10/11/17 15:59:22)
git-committer:
Rob Schluntz <rschlunt@…> (10/19/17 11:13:11)
Message:

Print EnumInstType? body flag and other minor cleanup

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r0a22cda r6137fbb  
    605605                                Alternative newerAlt( newAlt );
    606606                                newerAlt.env = newEnv;
    607                                 assert( (*candidate)->get_uniqueId() );
     607                                assertf( (*candidate)->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( *candidate ).c_str() );
    608608                                DeclarationWithType *candDecl = static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) );
    609609
  • src/SymTab/Indexer.cc

    r0a22cda r6137fbb  
    571571
    572572                if ( doDebug ) {
    573                         std::cout << "--- Entering scope " << scope << std::endl;
     573                        std::cerr << "--- Entering scope " << scope << std::endl;
    574574                }
    575575        }
    576576
    577577        void Indexer::leaveScope() {
    578                 using std::cout;
     578                using std::cerr;
    579579
    580580                assert( scope > 0 && "cannot leave initial scope" );
     581                if ( doDebug ) {
     582                        cerr << "--- Leaving scope " << scope << " containing" << std::endl;
     583                }
    581584                --scope;
    582585
    583586                while ( tables && tables->scope > scope ) {
    584587                        if ( doDebug ) {
    585                                 cout << "--- Leaving scope " << tables->scope << " containing" << std::endl;
    586                                 dump( tables->idTable, cout );
    587                                 dump( tables->typeTable, cout );
    588                                 dump( tables->structTable, cout );
    589                                 dump( tables->enumTable, cout );
    590                                 dump( tables->unionTable, cout );
    591                                 dump( tables->traitTable, cout );
     588                                dump( tables->idTable, cerr );
     589                                dump( tables->typeTable, cerr );
     590                                dump( tables->structTable, cerr );
     591                                dump( tables->enumTable, cerr );
     592                                dump( tables->unionTable, cerr );
     593                                dump( tables->traitTable, cerr );
    592594                        }
    593595
  • src/SynTree/ReferenceToType.cc

    r0a22cda r6137fbb  
    129129bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; }
    130130
     131void EnumInstType::print( std::ostream &os, Indenter indent ) const {
     132        using std::endl;
     133
     134        if ( baseEnum == nullptr ) ReferenceToType::print( os, indent );
     135        else {
     136                Type::print( os, indent );
     137                os << "instance of " << typeString() << " " << name << " with body " << baseEnum->has_body() << " ";
     138        } // if
     139}
     140
     141
    131142std::string TraitInstType::typeString() const { return "trait"; }
    132143
  • src/SynTree/Type.h

    r0a22cda r6137fbb  
    466466        virtual void accept( Visitor & v ) override { v.visit( this ); }
    467467        virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
     468
     469        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    468470  private:
    469471        virtual std::string typeString() const override;
Note: See TracChangeset for help on using the changeset viewer.