Changes in / [a6fe3de:bd34fc87]


Ignore:
Location:
src
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/GenType.cc

    ra6fe3de rbd34fc87  
    4242                virtual void visit( TypeInstType *typeInst );
    4343                virtual void visit( VarArgsType *varArgsType );
    44                 virtual void visit( ZeroType *zeroType );
    45                 virtual void visit( OneType *oneType );
    4644
    4745          private:
     
    202200        }
    203201
    204         void GenType::visit( ZeroType *zeroType ) {
    205                 // ideally these wouldn't hit codegen at all, but should be safe to make them ints
    206                 typeString = "int " + typeString;
    207                 handleQualifiers( zeroType );
    208         }
    209 
    210         void GenType::visit( OneType *oneType ) {
    211                 // ideally these wouldn't hit codegen at all, but should be safe to make them ints
    212                 typeString = "int " + typeString;
    213                 handleQualifiers( oneType );
    214         }
    215 
    216202        void GenType::handleQualifiers( Type *type ) {
    217203                if ( type->get_isConst() ) {
  • src/Makefile.in

    ra6fe3de rbd34fc87  
    165165        SynTree/driver_cfa_cpp-AttrType.$(OBJEXT) \
    166166        SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT) \
    167         SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT) \
    168167        SynTree/driver_cfa_cpp-Constant.$(OBJEXT) \
    169168        SynTree/driver_cfa_cpp-Expression.$(OBJEXT) \
     
    391390        SynTree/ReferenceToType.cc SynTree/TupleType.cc \
    392391        SynTree/TypeofType.cc SynTree/AttrType.cc \
    393         SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \
    394         SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \
     392        SynTree/VarArgsType.cc SynTree/Constant.cc \
     393        SynTree/Expression.cc SynTree/TupleExpr.cc \
    395394        SynTree/CommaExpr.cc SynTree/TypeExpr.cc \
    396395        SynTree/ApplicationExpr.cc SynTree/AddressExpr.cc \
     
    716715SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \
    717716        SynTree/$(DEPDIR)/$(am__dirstamp)
    718 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \
    719         SynTree/$(DEPDIR)/$(am__dirstamp)
    720717SynTree/driver_cfa_cpp-Constant.$(OBJEXT): SynTree/$(am__dirstamp) \
    721718        SynTree/$(DEPDIR)/$(am__dirstamp)
     
    880877        -rm -f SynTree/driver_cfa_cpp-Visitor.$(OBJEXT)
    881878        -rm -f SynTree/driver_cfa_cpp-VoidType.$(OBJEXT)
    882         -rm -f SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT)
    883879        -rm -f Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT)
    884880        -rm -f Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT)
     
    986982@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@
    987983@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@
    988 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po@am__quote@
    989984@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-NameMatcher.Po@am__quote@
    990985@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@
     
    20692064@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    20702065@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi`
    2071 
    2072 SynTree/driver_cfa_cpp-ZeroOneType.o: SynTree/ZeroOneType.cc
    2073 @am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc
    2074 @am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po
    2075 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.o' libtool=no @AMDEPBACKSLASH@
    2076 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    2077 @am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc
    2078 
    2079 SynTree/driver_cfa_cpp-ZeroOneType.obj: SynTree/ZeroOneType.cc
    2080 @am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`
    2081 @am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po
    2082 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.obj' libtool=no @AMDEPBACKSLASH@
    2083 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    2084 @am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`
    20852066
    20862067SynTree/driver_cfa_cpp-Constant.o: SynTree/Constant.cc
  • src/ResolvExpr/AdjustExprType.cc

    ra6fe3de rbd34fc87  
    3737                virtual Type* mutate( TupleType *tupleType );
    3838                virtual Type* mutate( VarArgsType *varArgsType );
    39                 virtual Type* mutate( ZeroType *zeroType );
    40                 virtual Type* mutate( OneType *oneType );
    4139
    4240                const TypeEnvironment &env;
     
    119117                return varArgsType;
    120118        }
    121 
    122         Type *AdjustExprType::mutate( ZeroType *zeroType ) {
    123                 return zeroType;
    124         }
    125 
    126         Type *AdjustExprType::mutate( OneType *oneType ) {
    127                 return oneType;
    128         }
    129119} // namespace ResolvExpr
    130120
  • src/ResolvExpr/CommonType.cc

    ra6fe3de rbd34fc87  
    3939                virtual void visit( TupleType *tupleType );
    4040                virtual void visit( VarArgsType *varArgsType );
    41                 virtual void visit( ZeroType *zeroType );
    42                 virtual void visit( OneType *oneType );
    4341
    4442                template< typename RefType > void handleRefType( RefType *inst, Type *other );
     
    136134                                result = new BasicType( basicType->get_qualifiers() + otherBasic->get_qualifiers(), newType );
    137135                        } // if
    138                 } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {
    139                         // use signed int in lieu of the enum/zero/one type
     136                } else if ( EnumInstType *enumInstType = dynamic_cast< EnumInstType * > ( type2 ) ) {
     137                        // use signed int in lieu of the enum type
    140138                        BasicType::Kind newType = combinedType[ basicType->get_kind() ][ BasicType::SignedInt ];
    141                         if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) {
    142                                 result = new BasicType( basicType->get_qualifiers() + type2->get_qualifiers(), newType );
     139                        if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= enumInstType->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= enumInstType->get_qualifiers() ) || widenSecond ) ) {
     140                                result = new BasicType( basicType->get_qualifiers() + enumInstType->get_qualifiers(), newType );
    143141                        } // if
    144142                } // if
     
    173171                                otherPointer->get_base()->get_qualifiers() = tq2;
    174172                        } // if
    175                 } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {
    176                         result = pointerType->clone();
    177                         result->get_qualifiers() += type2->get_qualifiers();
    178173                } // if
    179174        }
     
    195190
    196191        void CommonType::visit( EnumInstType *enumInstType ) {
    197                 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {
     192                if ( dynamic_cast< BasicType * >( type2 ) ) {
    198193                        // reuse BasicType, EnumInstType code by swapping type2 with enumInstType
    199194                        Type * temp = type2;
     
    235230        void CommonType::visit( VarArgsType *varArgsType ) {
    236231        }
    237 
    238         void CommonType::visit( ZeroType *zeroType ) {
    239                 if ( widenFirst ) {
    240                         if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) {
    241                                 if ( widenSecond || zeroType->get_qualifiers() <= type2->get_qualifiers() ) {
    242                                         result = type2->clone();
    243                                         result->get_qualifiers() += zeroType->get_qualifiers();
    244                                 }
    245                         }
    246                 }
    247         }
    248 
    249         void CommonType::visit( OneType *oneType ) {
    250                 if ( widenFirst ) {
    251                         if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) {
    252                                 if ( widenSecond || oneType->get_qualifiers() <= type2->get_qualifiers() ) {
    253                                         result = type2->clone();
    254                                         result->get_qualifiers() += oneType->get_qualifiers();
    255                                 }
    256                         }
    257                 }
    258         }
    259232} // namespace ResolvExpr
    260233
  • src/ResolvExpr/ConversionCost.cc

    ra6fe3de rbd34fc87  
    160160                        // xxx - not positive this is correct, but appears to allow casting int => enum
    161161                        cost = Cost( 1, 0, 0 );
    162                 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {
    163                         cost = Cost( 1, 0, 0 );
    164                 } // if
     162    } // if
    165163        }
    166164
     
    177175                                } // if
    178176                        } // if
    179                 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {
    180                         cost = Cost( 1, 0, 0 );
    181177                } // if
    182178        }
     
    260256                }
    261257        }
    262 
    263         void ConversionCost::visit(ZeroType *zeroType) {
    264                 if ( dynamic_cast< ZeroType* >( dest ) ) {
    265                         cost = Cost::zero;
    266                 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
    267                         // copied from visit(BasicType*) for signed int, but +1 for safe conversions
    268                         int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];
    269                         if ( tableResult == -1 ) {
    270                                 cost = Cost( 1, 0, 0 );
    271                         } else {
    272                                 cost = Cost( 0, 0, tableResult + 1 );
    273                         }
    274                 } else if ( dynamic_cast< PointerType* >( dest ) ) {
    275                         cost = Cost( 0, 0, 1 );
    276                 }
    277         }
    278 
    279         void ConversionCost::visit(OneType *oneType) {
    280                 if ( dynamic_cast< OneType* >( dest ) ) {
    281                         cost = Cost::zero;
    282                 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
    283                         // copied from visit(BasicType*) for signed int, but +1 for safe conversions
    284                         int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];
    285                         if ( tableResult == -1 ) {
    286                                 cost = Cost( 1, 0, 0 );
    287                         } else {
    288                                 cost = Cost( 0, 0, tableResult + 1 );
    289                         }
    290                 }
    291         }
    292258} // namespace ResolvExpr
    293259
  • src/ResolvExpr/ConversionCost.h

    ra6fe3de rbd34fc87  
    4141                virtual void visit(TupleType *tupleType);
    4242                virtual void visit(VarArgsType *varArgsType);
    43                 virtual void visit(ZeroType *zeroType);
    44                 virtual void visit(OneType *oneType);
    4543          protected:
    4644                Type *dest;
  • src/ResolvExpr/PtrsAssignable.cc

    ra6fe3de rbd34fc87  
    3939                virtual void visit( TupleType *tupleType );
    4040                virtual void visit( VarArgsType *varArgsType );
    41                 virtual void visit( ZeroType *zeroType );
    42                 virtual void visit( OneType *oneType );
    4341          private:
    4442                Type *dest;
     
    143141        void PtrsAssignable::visit( VarArgsType *varArgsType ) {
    144142        }
    145 
    146         void PtrsAssignable::visit( ZeroType *zeroType ) {
    147         }
    148        
    149         void PtrsAssignable::visit( OneType *oneType ) {
    150         }
    151        
    152143} // namespace ResolvExpr
    153144
  • src/ResolvExpr/PtrsCastable.cc

    ra6fe3de rbd34fc87  
    4040                virtual void visit(TupleType *tupleType);
    4141                virtual void visit(VarArgsType *varArgsType);
    42                 virtual void visit(ZeroType *zeroType);
    43                 virtual void visit(OneType *oneType);
    4442          private:
    4543                Type *dest;
     
    146144                result = objectCast( dest, env, indexer );
    147145        }
    148 
    149         void PtrsCastable::visit(ZeroType *zeroType) {
    150                 result = objectCast( dest, env, indexer );
    151         }
    152 
    153         void PtrsCastable::visit(OneType *oneType) {
    154                 result = objectCast( dest, env, indexer );
    155         }
    156146} // namespace ResolvExpr
    157147
  • src/ResolvExpr/RenameVars.cc

    ra6fe3de rbd34fc87  
    110110        }
    111111
    112         void RenameVars::visit( ZeroType *zeroType ) {
    113                 typeBefore( zeroType );
    114                 typeAfter( zeroType );
    115         }
    116 
    117         void RenameVars::visit( OneType *oneType ) {
    118                 typeBefore( oneType );
    119                 typeAfter( oneType );
    120         }
    121 
    122112        void RenameVars::typeBefore( Type *type ) {
    123113                if ( ! type->get_forall().empty() ) {
  • src/ResolvExpr/RenameVars.h

    ra6fe3de rbd34fc87  
    4444                virtual void visit( TupleType *tupleType );
    4545                virtual void visit( VarArgsType *varArgsType );
    46                 virtual void visit( ZeroType *zeroType );
    47                 virtual void visit( OneType *oneType );
    4846
    4947                void typeBefore( Type *type );
  • src/ResolvExpr/Resolver.cc

    ra6fe3de rbd34fc87  
    133133                        } else if ( BasicType *bt = dynamic_cast< BasicType * >( type ) ) {
    134134                                return bt->isInteger();
    135                         } else if ( dynamic_cast< ZeroType* >( type ) != nullptr || dynamic_cast< OneType* >( type ) != nullptr ) {
    136                                 return true;
    137135                        } else {
    138136                                return false;
     
    461459                        }
    462460                } else {
    463                         assert( dynamic_cast< BasicType * >( initContext ) || dynamic_cast< PointerType * >( initContext )
    464                                 || dynamic_cast< ZeroType * >( initContext ) || dynamic_cast< OneType * >( initContext ) );
     461                        assert( dynamic_cast< BasicType * >( initContext ) || dynamic_cast< PointerType * >( initContext ) );
    465462                        // basic types are handled here
    466463                        Visitor::visit( listInit );
  • src/ResolvExpr/Unify.cc

    ra6fe3de rbd34fc87  
    6060                virtual void visit(TupleType *tupleType);
    6161                virtual void visit(VarArgsType *varArgsType);
    62                 virtual void visit(ZeroType *zeroType);
    63                 virtual void visit(OneType *oneType);
    6462
    6563                template< typename RefType > void handleRefType( RefType *inst, Type *other );
     
    590588        }
    591589
    592         void Unify::visit(ZeroType *zeroType) {
    593                 result = dynamic_cast< ZeroType* >( type2 );
    594         }
    595 
    596         void Unify::visit(OneType *oneType) {
    597                 result = dynamic_cast< OneType* >( type2 );
    598         }
    599 
    600590} // namespace ResolvExpr
    601591
  • src/SymTab/FixFunction.cc

    ra6fe3de rbd34fc87  
    7777                return varArgsType;
    7878        }
    79 
    80         Type * FixFunction::mutate(ZeroType *zeroType) {
    81                 return zeroType;
    82         }
    83 
    84         Type * FixFunction::mutate(OneType *oneType) {
    85                 return oneType;
    86         }
    8779} // namespace SymTab
    8880
  • src/SymTab/FixFunction.h

    ra6fe3de rbd34fc87  
    4242                virtual Type* mutate(TupleType *tupleType);
    4343                virtual Type* mutate(VarArgsType *varArgsType);
    44                 virtual Type* mutate(ZeroType *zeroType);
    45                 virtual Type* mutate(OneType *oneType);
    4644 
    4745                bool isVoid;
  • src/SymTab/ImplementationType.cc

    ra6fe3de rbd34fc87  
    4141                virtual void visit(TupleType *tupleType);
    4242                virtual void visit(VarArgsType *varArgsType);
    43                 virtual void visit(ZeroType *zeroType);
    44                 virtual void visit(OneType *oneType);
    4543
    4644                Type *result;                   // synthesized
     
    122120        void ImplementationType::visit(VarArgsType *varArgsType) {
    123121        }
    124 
    125         void ImplementationType::visit(ZeroType *zeroType) {
    126         }
    127 
    128         void ImplementationType::visit(OneType *oneType) {
    129         }
    130122} // namespace SymTab
    131123
  • src/SymTab/Mangler.cc

    ra6fe3de rbd34fc87  
    229229                printQualifiers( varArgsType );
    230230                mangleName << "VARGS";
    231         }
    232 
    233         void Mangler::visit( ZeroType *zeroType ) {
    234                 mangleName << "Z";
    235         }
    236 
    237         void Mangler::visit( OneType *oneType ) {
    238                 mangleName << "O";
    239231        }
    240232
  • src/SymTab/Mangler.h

    ra6fe3de rbd34fc87  
    4646                virtual void visit( TupleType *tupleType );
    4747                virtual void visit( VarArgsType *varArgsType );
    48                 virtual void visit( ZeroType *zeroType );
    49                 virtual void visit( OneType *oneType );
    5048 
    5149                std::string get_mangleName() { return mangleName.str(); }
  • src/SymTab/TypeEquality.cc

    ra6fe3de rbd34fc87  
    4242                virtual void visit( TypeInstType *typeInst );
    4343                virtual void visit( VarArgsType *varArgsType );
    44                 virtual void visit( ZeroType *zeroType );
    45                 virtual void visit( OneType *oneType );
    4644
    4745                void handleQualifiers( Type * t );
     
    201199                }
    202200        }
    203 
    204         void TypeEquality::visit( ZeroType *zeroType ) {
    205                 handleQualifiers( zeroType );
    206                 if ( ! dynamic_cast< ZeroType * >( other ) ) {
    207                         result = false;
    208                 }
    209         }
    210 
    211         void TypeEquality::visit( OneType *oneType ) {
    212                 handleQualifiers( oneType );
    213                 if ( ! dynamic_cast< OneType * >( other ) ) {
    214                         result = false;
    215                 }
    216         }
    217201} // namespace SymTab
  • src/SynTree/Mutator.cc

    ra6fe3de rbd34fc87  
    453453}
    454454
    455 Type *Mutator::mutate( ZeroType *zeroType ) {
    456         mutateAll( zeroType->get_forall(), *this );
    457         return zeroType;
    458 }
    459 
    460 Type *Mutator::mutate( OneType *oneType ) {
    461         mutateAll( oneType->get_forall(), *this );
    462         return oneType;
    463 }
    464 
    465455Initializer *Mutator::mutate( SingleInit *singleInit ) {
    466456        singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
  • src/SynTree/Mutator.h

    ra6fe3de rbd34fc87  
    9595        virtual Type* mutate( AttrType *attrType );
    9696        virtual Type* mutate( VarArgsType *varArgsType );
    97         virtual Type* mutate( ZeroType *zeroType );
    98         virtual Type* mutate( OneType *oneType );
    9997
    10098        virtual Initializer* mutate( SingleInit *singleInit );
  • src/SynTree/SynTree.h

    ra6fe3de rbd34fc87  
    102102class AttrType;
    103103class VarArgsType;
    104 class ZeroType;
    105 class OneType;
    106104
    107105class Initializer;
  • src/SynTree/Type.h

    ra6fe3de rbd34fc87  
    418418};
    419419
    420 /// Represents a zero constant
    421 class ZeroType : public Type {
    422   public:
    423         ZeroType();
    424         ZeroType( Type::Qualifiers tq );
    425 
    426         virtual ZeroType *clone() const { return new ZeroType( *this ); }
    427         virtual void accept( Visitor &v ) { v.visit( this ); }
    428         virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    429         virtual void print( std::ostream &os, int indent = 0 ) const;
    430 };
    431 
    432 /// Represents a one constant
    433 class OneType : public Type {
    434   public:
    435         OneType();
    436         OneType( Type::Qualifiers tq );
    437 
    438         virtual OneType *clone() const { return new OneType( *this ); }
    439         virtual void accept( Visitor &v ) { v.visit( this ); }
    440         virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    441         virtual void print( std::ostream &os, int indent = 0 ) const;
    442 };
    443 
    444420inline Type::Qualifiers &Type::Qualifiers::operator+=( const Type::Qualifiers &other ) {
    445421        isConst |= other.isConst;
  • src/SynTree/TypeSubstitution.cc

    ra6fe3de rbd34fc87  
    179179}
    180180
    181 Type * TypeSubstitution::mutate( VoidType *voidType ) {
    182         return handleType( voidType );
     181Type * TypeSubstitution::mutate( VoidType *basicType ) {
     182        return handleType( basicType );
    183183}
    184184
     
    221221Type * TypeSubstitution::mutate( VarArgsType *varArgsType ) {
    222222        return handleType( varArgsType );
    223 }
    224 
    225 Type * TypeSubstitution::mutate( ZeroType *zeroType ) {
    226         return handleType( zeroType );
    227 }
    228 
    229 Type * TypeSubstitution::mutate( OneType *oneType ) {
    230         return handleType( oneType );
    231223}
    232224
  • src/SynTree/TypeSubstitution.h

    ra6fe3de rbd34fc87  
    7676        virtual Type* mutate(TupleType *tupleType);
    7777        virtual Type* mutate(VarArgsType *varArgsType);
    78         virtual Type* mutate(ZeroType *zeroType);
    79         virtual Type* mutate(OneType *oneType);
    8078
    8179        // TODO: worry about traversing into a forall-qualified function type or type decl with assertions
  • src/SynTree/Visitor.cc

    ra6fe3de rbd34fc87  
    383383}
    384384
    385 void Visitor::visit( ZeroType *zeroType ) {
    386         acceptAll( zeroType->get_forall(), *this );
    387 }
    388 
    389 void Visitor::visit( OneType *oneType ) {
    390         acceptAll( oneType->get_forall(), *this );
    391 }
    392 
    393385void Visitor::visit( SingleInit *singleInit ) {
    394386        singleInit->get_value()->accept( *this );
  • src/SynTree/Visitor.h

    ra6fe3de rbd34fc87  
    9595        virtual void visit( AttrType *attrType );
    9696        virtual void visit( VarArgsType *varArgsType );
    97         virtual void visit( ZeroType *zeroType );
    98         virtual void visit( OneType *oneType );
    9997
    10098        virtual void visit( SingleInit *singleInit );
  • src/SynTree/module.mk

    ra6fe3de rbd34fc87  
    2626       SynTree/AttrType.cc \
    2727       SynTree/VarArgsType.cc \
    28        SynTree/ZeroOneType.cc \
    2928       SynTree/Constant.cc \
    3029       SynTree/Expression.cc \
Note: See TracChangeset for help on using the changeset viewer.