Changeset b181639 for src/CodeTools


Ignore:
Timestamp:
Sep 13, 2018, 10:26:06 AM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
40cd873
Parents:
3b3491b
Message:

refinements to ResolvProtoDump? output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeTools/ResolvProtoDump.cc

    r3b3491b rb181639  
    3737        class ProtoDump : public WithShortCircuiting, public WithVisitorRef<ProtoDump> {
    3838                std::set<std::string> decls;               ///< Declarations in this scope
    39                 std::set<std::string> exprs;               ///< Expressions in this scope
     39                std::vector<std::string> exprs;            ///< Expressions in this scope
    4040                std::vector<PassVisitor<ProtoDump>> subs;  ///< Sub-scopes
    4141                const ProtoDump* parent;                   ///< Outer lexical scope
     
    6363                /// adds a new expression to this scope
    6464                void addExpr( const std::string& s ) {
    65                         if ( ! s.empty() ) { exprs.insert( s ); }
     65                        if ( ! s.empty() ) { exprs.emplace_back( s ); }
    6666                }
    6767
     
    198198
    199199                        // arrays represented as generic type
    200                         void previsit( ArrayType* ) { ss << "#$arr<"; ++depth; }
    201                         void postvisit( ArrayType* ) { --depth; ss << '>'; }
     200                        void previsit( ArrayType* at ) {
     201                                ss << "#$arr<";
     202                                ++depth;
     203                                at->base->accept( *visitor );
     204                                --depth;
     205                                ss << '>';
     206                                visit_children = false;
     207                        }
    202208
    203209                        // ignore top-level reference types, they're mostly transparent to resolution
     
    380386                        }
    381387
    382                         /// Casts replaced with arguments
    383                         /// TODO put casts in resolv-proto
     388                        /// Casts replaced with result type
     389                        /// TODO put cast target functions in, and add second expression for target
     390                        void previsit( CastExpr* cast ) {
     391                                PassVisitor<TypePrinter> tyPrinter{ ss };
     392                                cast->result->accept( tyPrinter );
     393                                visit_children = false;
     394                        }
    384395                       
    385396                        /// Member access handled as function from aggregate to member
Note: See TracChangeset for help on using the changeset viewer.