Changeset a2dbcff1


Ignore:
Timestamp:
Dec 14, 2018, 2:47:57 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
107b01a
Parents:
6ebc13f
Message:

Fixed warning and spacing

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeTools/ResolvProtoDump.cc

    r6ebc13f ra2dbcff1  
    5151
    5252                /// Child constructor
    53                 ProtoDump(const ProtoDump* p, Type* r) 
     53                ProtoDump(const ProtoDump* p, Type* r)
    5454                        : decls(), exprs(), subs(), closed(p->closed), parent(p), rtnType(r) {}
    5555
    5656                // Fix copy issues
    57                 ProtoDump(const ProtoDump& o) 
    58                         : decls(o.decls), exprs(o.exprs), subs(o.subs), closed(o.closed), parent(o.parent), 
     57                ProtoDump(const ProtoDump& o)
     58                        : decls(o.decls), exprs(o.exprs), subs(o.subs), closed(o.closed), parent(o.parent),
    5959                          rtnType(maybeClone(o.rtnType.get())) {}
    6060                ProtoDump( ProtoDump&& ) = default;
     
    6969                        parent = o.parent;
    7070                        rtnType.reset( maybeClone(o.rtnType.get()) );
    71                        
     71
    7272                        return *this;
    7373                }
    74                 ProtoDump& operator= (ProtoDump&&) = default;
     74                ProtoDump& operator= (ProtoDump&&) = delete;
    7575
    7676        private:
     
    9696                        subs.emplace_back( std::move(sub.pass) );
    9797                }
    98        
     98
    9999                /// Whether lists should be separated, terminated, or preceded by their separator
    100100                enum septype { separated, terminated, preceded };
     
    102102                /// builds space-separated list of types
    103103                template<typename V>
    104                 static void build( V& visitor, const std::list< Type* >& tys, std::stringstream& ss, 
     104                static void build( V& visitor, const std::list< Type* >& tys, std::stringstream& ss,
    105105                                septype mode = separated ) {
    106106                        if ( tys.empty() ) return;
     
    121121                /// builds list of types wrapped as tuple type
    122122                template<typename V>
    123                 static void buildAsTuple( V& visitor, const std::list< Type* >& tys, 
     123                static void buildAsTuple( V& visitor, const std::list< Type* >& tys,
    124124                                std::stringstream& ss ) {
    125125                        switch ( tys.size() ) {
     
    162162                        if ( name.compare( 0, 10, "_operator_" ) == 0 ) {
    163163                                ss << name.substr(10);
    164                         } else if ( name.compare( "_constructor" ) == 0 
     164                        } else if ( name.compare( "_constructor" ) == 0
    165165                                        || name.compare( "_destructor" ) == 0 ) {
    166166                                ss << name.substr(1);
     
    173173
    174174                /// replaces operators with resolv-proto names
    175                 static void rp_name( const std::string& name, std::stringstream& ss, 
     175                static void rp_name( const std::string& name, std::stringstream& ss,
    176176                                std::string&& pre = "" ) {
    177177                        // safety check for anonymous names
     
    187187                                op_name( info.outputName, ss );
    188188                                return;
    189                         } 
    190                        
     189                        }
     190
    191191                        // replace retval names
    192192                        if ( name.compare( 0, 8, "_retval_" ) == 0 ) {
     
    195195                                return;
    196196                        }
    197                        
     197
    198198                        // default to just name, with first character in lowercase
    199                         ss << pre 
     199                        ss << pre
    200200                           << (char)std::tolower( static_cast<unsigned char>(name[0]) )
    201201                           << (name.c_str() + 1);
     
    221221                        // strip trailing "_generic_" from autogen names (avoids some user-generation issues)
    222222                        char generic[] = "_generic_"; size_t n_generic = sizeof(generic) - 1;
    223                         if ( stripped.size() >= n_generic 
     223                        if ( stripped.size() >= n_generic
    224224                                        && stripped.substr( stripped.size() - n_generic ) == generic ) {
    225225                                stripped.resize( stripped.size() - n_generic );
     
    237237                        unsigned depth;                                 ///< Depth of nesting from root type
    238238
    239                         TypePrinter( const std::unordered_set<std::string>& closed, std::stringstream& ss ) 
     239                        TypePrinter( const std::unordered_set<std::string>& closed, std::stringstream& ss )
    240240                                : ss(ss), closed(closed), depth(0) {}
    241241
     
    337337                        }
    338338                };
    339        
     339
    340340                /// builds description of function
    341341                void build( const std::string& name, FunctionType* fnTy, std::stringstream& ss ) {
     
    350350                        for ( TypeDecl* tyvar : fnTy->forall ) {
    351351                                for ( DeclarationWithType* assn : tyvar->assertions ) {
    352                                         ss << " | "; 
     352                                        ss << " | ";
    353353                                        build( assn->name, assn->get_type(), ss );
    354354                                }
     
    360360                        // ignore top-level references
    361361                        Type *norefs = ty->stripReferences();
    362                        
     362
    363363                        // fall back to function declaration if function type
    364364                        if ( PointerType* pTy = dynamic_cast< PointerType* >(norefs) ) {
     
    409409                        std::stringstream& ss;                          ///< Output to print to
    410410
    411                         ExprPrinter( const std::unordered_set<std::string>& closed, std::stringstream& ss ) 
     411                        ExprPrinter( const std::unordered_set<std::string>& closed, std::stringstream& ss )
    412412                                : closed(closed), ss(ss) {}
    413413
     
    476476                                visit_children = false;
    477477                        }
    478                        
     478
    479479                        /// Member access handled as function from aggregate to member
    480480                        void previsit( UntypedMemberExpr* expr ) {
     
    662662                                        }
    663663                                }
    664                                
     664
    665665                                // add named parameters and returns to local scope
    666666                                body.pass.addAll( decl->type->returnVals );
     
    679679                void previsit( StructDecl* sd ) { addAggregateFields(sd); }
    680680                void previsit( UnionDecl* ud ) { addAggregateFields(ud); }
    681                
     681
    682682                void previsit( EnumDecl* ed ) {
    683                         std::unique_ptr<Type> eType = 
     683                        std::unique_ptr<Type> eType =
    684684                                std::make_unique<BasicType>( Type::Qualifiers{}, BasicType::SignedInt );
    685                        
     685
    686686                        // add field names directly to enclosing scope
    687687                        for ( Declaration* member : ed->members ) {
  • src/config.h.in

    r6ebc13f ra2dbcff1  
    77#undef CFA_64_CPU
    88
    9 /* Location of include files. */
     9/* Backend compiler to use. */
    1010#undef CFA_BACKEND_CC
    1111
  • src/main.cc

    r6ebc13f ra2dbcff1  
    487487                        resolvep = true;
    488488                        break;
    489                         case 'R':                                                                               // dump resolv-proto instance
     489                  case 'R':                                                                             // dump resolv-proto instance
    490490                        resolvprotop = true;
    491491                        break;
Note: See TracChangeset for help on using the changeset viewer.