Changes in / [9c23f31:2298f728]


Ignore:
Files:
8 deleted
44 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/GenType.cc

    r9c23f31 r2298f728  
    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/InitTweak/FixInit.cc

    r9c23f31 r2298f728  
    3333#include "SymTab/Autogen.h"
    3434#include "GenPoly/PolyMutator.h"
    35 #include "GenPoly/DeclMutator.h"
    3635#include "SynTree/AddStmtVisitor.h"
    3736#include "CodeGen/GenType.h"  // for warnings
     
    217216                        SymTab::Indexer & indexer;
    218217                };
    219 
    220                 class FixCtorExprs : public GenPoly::DeclMutator {
    221                   public:
    222                         /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument
    223                         static void fix( std::list< Declaration * > & translationUnit );
    224 
    225                         virtual Expression * mutate( ConstructorExpr * ctorExpr );
    226                 };
    227218        } // namespace
    228219
     
    230221                // fixes ConstructorInit for global variables. should happen before fixInitializers.
    231222                InitTweak::fixGlobalInit( translationUnit, filename, inLibrary );
    232 
    233223
    234224                InsertImplicitCalls::insert( translationUnit );
     
    241231
    242232                GenStructMemberCalls::generate( translationUnit );
    243                 // xxx - ctor expansion currently has to be after FixCopyCtors, because there is currently a
    244                 // hack in the way untyped assignments are generated, where the first argument cannot have
    245                 // its address taken because of the way codegeneration handles UntypedExpr vs. ApplicationExpr.
    246                 // Thus such assignment exprs must never pushed through expression resolution (and thus should
    247                 // not go through the FixCopyCtors pass), otherwise they will fail -- guaranteed.
    248                 // Also needs to happen after GenStructMemberCalls, since otherwise member constructors exprs
    249                 // don't look right, and a member can be constructed more than once.
    250                 FixCtorExprs::fix( translationUnit );
    251233        }
    252234
     
    301283                                throw warner.errors;
    302284                        }
    303                 }
    304 
    305                 void FixCtorExprs::fix( std::list< Declaration * > & translationUnit ) {
    306                         FixCtorExprs fixer;
    307                         fixer.mutateDeclarationList( translationUnit );
    308285                }
    309286
     
    503480                                        retExpr = deref;
    504481                                } // if
    505                                 retExpr->set_env( env->clone() );
     482                                // xxx - might need to set env on retExpr...
     483                                // retExpr->set_env( env->clone() );
    506484                                return retExpr;
    507485                        } else {
     
    936914                        return safe_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) );
    937915                }
    938 
    939                 Expression * FixCtorExprs::mutate( ConstructorExpr * ctorExpr ) {
    940                         static UniqueName tempNamer( "_tmp_ctor_expr" );
    941                         assert( ctorExpr->get_results().size() == 1 );
    942                         ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_results().front()->clone(), nullptr );
    943                         addDeclaration( tmp );
    944 
    945                         ApplicationExpr * callExpr = safe_dynamic_cast< ApplicationExpr * > ( ctorExpr->get_callExpr() );
    946                         TypeSubstitution * env = ctorExpr->get_env();
    947                         ctorExpr->set_callExpr( nullptr );
    948                         ctorExpr->set_env( nullptr );
    949 
    950                         Expression *& firstArg = callExpr->get_args().front();
    951                         UntypedExpr * assign = new UntypedExpr( new NameExpr( "?=?" ) );
    952                         assign->get_args().push_back( new VariableExpr( tmp ) );
    953                         assign->get_args().push_back( firstArg );
    954                         cloneAll( ctorExpr->get_results(), assign->get_results() );
    955                         firstArg = assign;
    956 
    957                         CommaExpr * commaExpr = new CommaExpr( callExpr, new VariableExpr( tmp ) );
    958                         commaExpr->set_env( env );
    959                         delete ctorExpr;
    960                         return commaExpr;
    961                 }
    962916        } // namespace
    963917} // namespace InitTweak
  • src/InitTweak/InitTweak.cc

    r9c23f31 r2298f728  
    358358                template<typename CallExpr>
    359359                Expression *& callArg( CallExpr * callExpr, unsigned int pos ) {
    360                         if ( pos >= callExpr->get_args().size() ) assertf( false, "asking for argument that doesn't exist. Return NULL/throw exception?" );
     360                        if ( pos >= callExpr->get_args().size() ) assert( false && "asking for argument that doesn't exist. Return NULL/throw exception?" );
    361361                        for ( Expression *& arg : callExpr->get_args() ) {
    362362                                if ( pos == 0 ) return arg;
     
    373373                        return callArg( untypedExpr, pos );
    374374                } else {
    375                         assertf( false, "Unexpected expression type passed to getCallArg" );
     375                        assert( false && "Unexpected expression type passed to getCallArg" );
    376376                }
    377377        }
     
    387387                        } else if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( func ) ) {
    388388                                return memberExpr->get_member()->get_name();
    389                         } else if ( UntypedMemberExpr * memberExpr = dynamic_cast< UntypedMemberExpr * > ( func ) ) {
    390                                 return memberExpr->get_member();
    391389                        } else {
    392                                 assertf( false, "Unexpected expression type being called as a function in call expression" );
     390                                assert( false && "Unexpected expression type being called as a function in call expression" );
    393391                        }
    394392                }
     
    402400                } else {
    403401                        std::cerr << expr << std::endl;
    404                         assertf( false, "Unexpected expression type passed to getFunctionName" );
     402                        assert( false && "Unexpected expression type passed to getFunctionName" );
    405403                }
    406404        }
  • src/Makefile.in

    r9c23f31 r2298f728  
    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/Parser/parser.yy

    r9c23f31 r2298f728  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Sep 24 12:16:53 2016
    13 // Update Count     : 1992
     12// Last Modified On : Sat Sep 24 11:30:40 2016
     13// Update Count     : 1991
    1414//
    1515
     
    390390                {
    391391                        Token fn;
    392                         fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    393                         $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     392                        fn.str = new string( "?{}" );                           // location undefined
     393                        $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) );
    394394                }
    395395        ;
  • src/ResolvExpr/AdjustExprType.cc

    r9c23f31 r2298f728  
    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/AlternativeFinder.cc

    r9c23f31 r2298f728  
    197197        }
    198198
    199         void AlternativeFinder::find( Expression *expr, bool adjust, bool prune ) {
     199        void AlternativeFinder::find( Expression *expr, bool adjust ) {
    200200                expr->accept( *this );
    201201                if ( alternatives.empty() ) {
     
    207207                        }
    208208                }
    209                 if ( prune ) {
    210                         PRINT(
    211                                 std::cerr << "alternatives before prune:" << std::endl;
    212                                 printAlts( alternatives, std::cerr );
    213                         )
    214                         AltList::iterator oldBegin = alternatives.begin();
    215                         pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ), indexer );
    216                         if ( alternatives.begin() == oldBegin ) {
    217                                 std::ostringstream stream;
    218                                 stream << "Can't choose between alternatives for expression ";
    219                                 expr->print( stream );
    220                                 stream << "Alternatives are:";
    221                                 AltList winners;
    222                                 findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) );
    223                                 printAlts( winners, stream, 8 );
    224                                 throw SemanticError( stream.str() );
    225                         }
    226                         alternatives.erase( oldBegin, alternatives.end() );
    227                         PRINT(
    228                                 std::cerr << "there are " << alternatives.size() << " alternatives after elimination" << std::endl;
    229                         )
    230                 }
     209                PRINT(
     210                        std::cerr << "alternatives before prune:" << std::endl;
     211                        printAlts( alternatives, std::cerr );
     212                )
     213                AltList::iterator oldBegin = alternatives.begin();
     214                pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ), indexer );
     215                if ( alternatives.begin() == oldBegin ) {
     216                        std::ostringstream stream;
     217                        stream << "Can't choose between alternatives for expression ";
     218                        expr->print( stream );
     219                        stream << "Alternatives are:";
     220                        AltList winners;
     221                        findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) );
     222                        printAlts( winners, stream, 8 );
     223                        throw SemanticError( stream.str() );
     224                }
     225                alternatives.erase( oldBegin, alternatives.end() );
     226                PRINT(
     227                        std::cerr << "there are " << alternatives.size() << " alternatives after elimination" << std::endl;
     228                )
    231229
    232230                // Central location to handle gcc extension keyword for all expression types.
     
    236234        }
    237235
    238         void AlternativeFinder::findWithAdjustment( Expression *expr, bool prune ) {
    239                 find( expr, true, prune );
     236        void AlternativeFinder::findWithAdjustment( Expression *expr ) {
     237                find( expr, true );
    240238        }
    241239
    242240        template< typename StructOrUnionType >
    243         void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, const std::string &name ) {
     241        void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name ) {
    244242                std::list< Declaration* > members;
    245243                aggInst->lookup( name, members );
     
    762760                        if ( agg->expr->get_results().size() == 1 ) {
    763761                                if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_results().front() ) ) {
    764                                         addAggMembers( structInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() );
     762                                        addAggMembers( structInst, agg->expr, agg->cost, memberExpr->get_member() );
    765763                                } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_results().front() ) ) {
    766                                         addAggMembers( unionInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() );
     764                                        addAggMembers( unionInst, agg->expr, agg->cost, memberExpr->get_member() );
    767765                                } // if
    768766                        } // if
     
    791789                        renameTypes( alternatives.back().expr );
    792790                        if ( StructInstType *structInst = dynamic_cast< StructInstType* >( (*i)->get_type() ) ) {
    793                                 addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), env, "" );
     791                                addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), "" );
    794792                        } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( (*i)->get_type() ) ) {
    795                                 addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), env, "" );
     793                                addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), "" );
    796794                        } // if
    797795                } // for
     
    10141012                alternatives.push_back( Alternative( impCpCtorExpr->clone(), env, Cost::zero ) );
    10151013        }
    1016 
    1017         void AlternativeFinder::visit( ConstructorExpr * ctorExpr ) {
    1018                 AlternativeFinder finder( indexer, env );
    1019                 // don't prune here, since it's guaranteed all alternatives will have the same type
    1020                 // (giving the alternatives different types is half of the point of ConstructorExpr nodes)
    1021                 finder.findWithAdjustment( ctorExpr->get_callExpr(), false );
    1022                 for ( Alternative & alt : finder.alternatives ) {
    1023                         alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) );
    1024                 }
    1025         }
    10261014} // namespace ResolvExpr
    10271015
  • src/ResolvExpr/AlternativeFinder.h

    r9c23f31 r2298f728  
    2929          public:
    3030                AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env );
    31                 void find( Expression *expr, bool adjust = false, bool prune = true );
     31                void find( Expression *expr, bool adjust = false );
    3232                /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types
    33                 void findWithAdjustment( Expression *expr, bool prune = true );
     33                void findWithAdjustment( Expression *expr );
    3434                AltList &get_alternatives() { return alternatives; }
    3535
     
    6666                virtual void visit( TupleExpr *tupleExpr );
    6767                virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr );
    68                 virtual void visit( ConstructorExpr * ctorExpr );
    6968          public:  // xxx - temporary hack - should make Tuples::TupleAssignment a friend
    7069                template< typename InputIterator, typename OutputIterator >
     
    7372          private:
    7473                /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member
    75                 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, const std::string &name );
     74                template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name );
    7675                /// Adds alternatives for offsetof expressions, given the base type and name of the member
    7776                template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name );
  • src/ResolvExpr/CommonType.cc

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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/SymTab/Validate.cc

    r9c23f31 r2298f728  
    6060#include "ResolvExpr/typeops.h"
    6161#include <algorithm>
    62 #include "InitTweak/InitTweak.h"
    6362
    6463#define debugPrint( x ) if ( doDebug ) { std::cout << x; }
     
    172171        };
    173172
    174         class VerifyCtorDtorAssign : public Visitor {
     173        class VerifyCtorDtor : public Visitor {
    175174        public:
    176                 /// ensure that constructors, destructors, and assignment have at least one
    177                 /// parameter, the first of which must be a pointer, and that ctor/dtors have no
     175                /// ensure that constructors and destructors have at least one
     176                /// parameter, the first of which must be a pointer, and no
    178177                /// return values.
    179178                static void verify( std::list< Declaration * > &translationUnit );
     
    203202                compoundliteral.mutateDeclarationList( translationUnit );
    204203                acceptAll( translationUnit, pass3 );
    205                 VerifyCtorDtorAssign::verify( translationUnit );
     204                VerifyCtorDtor::verify( translationUnit );
    206205        }
    207206
     
    688687        }
    689688
    690         void VerifyCtorDtorAssign::verify( std::list< Declaration * > & translationUnit ) {
    691                 VerifyCtorDtorAssign verifier;
     689        void VerifyCtorDtor::verify( std::list< Declaration * > & translationUnit ) {
     690                VerifyCtorDtor verifier;
    692691                acceptAll( translationUnit, verifier );
    693692        }
    694693
    695         void VerifyCtorDtorAssign::visit( FunctionDecl * funcDecl ) {
     694        void VerifyCtorDtor::visit( FunctionDecl * funcDecl ) {
    696695                FunctionType * funcType = funcDecl->get_functionType();
    697696                std::list< DeclarationWithType * > &returnVals = funcType->get_returnVals();
    698697                std::list< DeclarationWithType * > &params = funcType->get_parameters();
    699698
    700                 if ( InitTweak::isCtorDtorAssign( funcDecl->get_name() ) ) {
     699                if ( funcDecl->get_name() == "?{}" || funcDecl->get_name() == "^?{}" ) {
    701700                        if ( params.size() == 0 ) {
    702                                 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl );
     701                                throw SemanticError( "Constructors and destructors require at least one parameter ", funcDecl );
    703702                        }
    704703                        if ( ! dynamic_cast< PointerType * >( params.front()->get_type() ) ) {
    705                                 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer ", funcDecl );
     704                                throw SemanticError( "First parameter of a constructor or destructor must be a pointer ", funcDecl );
    706705                        }
    707                         if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {
     706                        if ( returnVals.size() != 0 ) {
    708707                                throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl );
    709708                        }
  • src/SynTree/Expression.cc

    r9c23f31 r2298f728  
    2828#include "TypeSubstitution.h"
    2929#include "Common/utility.h"
    30 #include "InitTweak/InitTweak.h"
    3130
    3231
     
    494493
    495494void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
    496         os << "Implicit Copy Constructor Expression: " << std::endl;
     495        os << std::string( indent, ' ' ) << "Implicit Copy Constructor Expression: " << std::endl;
    497496        assert( callExpr );
    498497        callExpr->print( os, indent + 2 );
     
    504503}
    505504
    506 
    507 ConstructorExpr::ConstructorExpr( Expression * callExpr ) : callExpr( callExpr ) {
    508         // allow resolver to type a constructor used as an expression as if it has the same type as its first argument
    509         assert( callExpr );
    510         Expression * arg = InitTweak::getCallArg( callExpr, 0 );
    511         assert( arg );
    512         cloneAll( arg->get_results(), results );
    513 }
    514 
    515 ConstructorExpr::ConstructorExpr( const ConstructorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) {
    516 }
    517 
    518 ConstructorExpr::~ConstructorExpr() {
    519         delete callExpr;
    520 }
    521 
    522 void ConstructorExpr::print( std::ostream &os, int indent ) const {
    523         os <<  "Constructor Expression: " << std::endl;
    524         assert( callExpr );
    525         os << std::string( indent+2, ' ' );
    526         callExpr->print( os, indent + 2 );
    527         Expression::print( os, indent );
     505UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
     506
     507UntypedValofExpr::~UntypedValofExpr() { delete body; }
     508
     509void UntypedValofExpr::print( std::ostream &os, int indent ) const {
     510        os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
     511        if ( get_body() != 0 )
     512                get_body()->print( os, indent + 2 );
    528513}
    529514
     
    544529        if ( type ) type->print( os, indent + 2 );
    545530        if ( initializer ) initializer->print( os, indent + 2 );
    546 }
    547 
    548 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
    549 
    550 UntypedValofExpr::~UntypedValofExpr() { delete body; }
    551 
    552 void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    553         os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
    554         if ( get_body() != 0 )
    555                 get_body()->print( os, indent + 2 );
    556531}
    557532
  • src/SynTree/Expression.h

    r9c23f31 r2298f728  
    595595};
    596596
    597 /// ConstructorExpr represents the use of a constructor in an expression context, e.g. int * x = malloc() { 5 };
    598 class ConstructorExpr : public Expression {
    599 public:
    600         ConstructorExpr( Expression * callExpr );
    601         ConstructorExpr( const ConstructorExpr & other );
    602         ~ConstructorExpr();
    603 
    604         Expression *get_callExpr() const { return callExpr; }
    605         void set_callExpr( Expression *newValue ) { callExpr = newValue; }
    606 
    607         virtual ConstructorExpr *clone() const { return new ConstructorExpr( *this ); }
    608         virtual void accept( Visitor &v ) { v.visit( this ); }
    609         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    610         virtual void print( std::ostream &os, int indent = 0 ) const;
    611 private:
    612         Expression * callExpr;
     597/// ValofExpr represents a GCC 'lambda expression'
     598class UntypedValofExpr : public Expression {
     599  public:
     600        UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {}
     601        UntypedValofExpr( const UntypedValofExpr & other );
     602        virtual ~UntypedValofExpr();
     603
     604        Expression *get_value();
     605        Statement *get_body() const { return body; }
     606
     607        virtual UntypedValofExpr *clone() const { return new UntypedValofExpr( *this ); }
     608        virtual void accept( Visitor &v ) { v.visit( this ); }
     609        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     610        virtual void print( std::ostream &os, int indent = 0 ) const;
     611  private:
     612        Statement *body;
    613613};
    614614
     
    635635};
    636636
    637 /// ValofExpr represents a GCC 'lambda expression'
    638 class UntypedValofExpr : public Expression {
    639   public:
    640         UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {}
    641         UntypedValofExpr( const UntypedValofExpr & other );
    642         virtual ~UntypedValofExpr();
    643 
    644         Expression *get_value();
    645         Statement *get_body() const { return body; }
    646 
    647         virtual UntypedValofExpr *clone() const { return new UntypedValofExpr( *this ); }
    648         virtual void accept( Visitor &v ) { v.visit( this ); }
    649         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    650         virtual void print( std::ostream &os, int indent = 0 ) const;
    651   private:
    652         Statement *body;
    653 };
    654 
    655 /// RangeExpr represents a range e.g. '3 ... 5' or '1~10'
    656637class RangeExpr : public Expression {
    657638  public:
  • src/SynTree/Mutator.cc

    r9c23f31 r2298f728  
    339339}
    340340
    341 Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) {
    342         mutateAll( ctorExpr->get_results(), *this );
    343         ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) );
    344         return ctorExpr;
     341Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
     342        mutateAll( valofExpr->get_results(), *this );
     343        return valofExpr;
    345344}
    346345
     
    350349        compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) );
    351350        return compLitExpr;
    352 }
    353 
    354 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    355         mutateAll( valofExpr->get_results(), *this );
    356         return valofExpr;
    357351}
    358352
     
    453447}
    454448
    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 
    465449Initializer *Mutator::mutate( SingleInit *singleInit ) {
    466450        singleInit->set_value( singleInit->get_value()->acceptMutator( *this ) );
  • src/SynTree/Mutator.h

    r9c23f31 r2298f728  
    7676        virtual Expression* mutate( AsmExpr *asmExpr );
    7777        virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr );
    78         virtual Expression* mutate( ConstructorExpr *ctorExpr );
     78        virtual Expression* mutate( UntypedValofExpr *valofExpr );
    7979        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr );
    80         virtual Expression* mutate( UntypedValofExpr *valofExpr );
    8180        virtual Expression* mutate( RangeExpr *rangeExpr );
    8281
     
    9594        virtual Type* mutate( AttrType *attrType );
    9695        virtual Type* mutate( VarArgsType *varArgsType );
    97         virtual Type* mutate( ZeroType *zeroType );
    98         virtual Type* mutate( OneType *oneType );
    9996
    10097        virtual Initializer* mutate( SingleInit *singleInit );
  • src/SynTree/SynTree.h

    r9c23f31 r2298f728  
    8181class AsmExpr;
    8282class ImplicitCopyCtorExpr;
    83 class ConstructorExpr;
     83class UntypedValofExpr;
    8484class CompoundLiteralExpr;
    85 class UntypedValofExpr;
    8685class RangeExpr;
    8786
     
    102101class AttrType;
    103102class VarArgsType;
    104 class ZeroType;
    105 class OneType;
    106103
    107104class Initializer;
  • src/SynTree/Type.h

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    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

    r9c23f31 r2298f728  
    287287}
    288288
    289 void Visitor::visit( ConstructorExpr * ctorExpr ) {
    290         acceptAll( ctorExpr->get_results(), *this );
    291         maybeAccept( ctorExpr->get_callExpr(), *this );
     289void Visitor::visit( UntypedValofExpr *valofExpr ) {
     290        acceptAll( valofExpr->get_results(), *this );
     291        maybeAccept( valofExpr->get_body(), *this );
    292292}
    293293
     
    296296        maybeAccept( compLitExpr->get_type(), *this );
    297297        maybeAccept( compLitExpr->get_initializer(), *this );
    298 }
    299 
    300 void Visitor::visit( UntypedValofExpr *valofExpr ) {
    301         acceptAll( valofExpr->get_results(), *this );
    302         maybeAccept( valofExpr->get_body(), *this );
    303298}
    304299
     
    383378}
    384379
    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 
    393380void Visitor::visit( SingleInit *singleInit ) {
    394381        singleInit->get_value()->accept( *this );
  • src/SynTree/Visitor.h

    r9c23f31 r2298f728  
    7676        virtual void visit( AsmExpr *asmExpr );
    7777        virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr );
    78         virtual void visit( ConstructorExpr * ctorExpr );
     78        virtual void visit( UntypedValofExpr *valofExpr );
    7979        virtual void visit( CompoundLiteralExpr *compLitExpr );
    80         virtual void visit( UntypedValofExpr *valofExpr );
    8180        virtual void visit( RangeExpr *rangeExpr );
    8281
     
    9594        virtual void visit( AttrType *attrType );
    9695        virtual void visit( VarArgsType *varArgsType );
    97         virtual void visit( ZeroType *zeroType );
    98         virtual void visit( OneType *oneType );
    9996
    10097        virtual void visit( SingleInit *singleInit );
  • src/SynTree/module.mk

    r9c23f31 r2298f728  
    2626       SynTree/AttrType.cc \
    2727       SynTree/VarArgsType.cc \
    28        SynTree/ZeroOneType.cc \
    2928       SynTree/Constant.cc \
    3029       SynTree/Expression.cc \
  • src/examples/gc_no_raii/src/internal/card_table.h

    r9c23f31 r2298f728  
    1818};
    1919
    20 static inline void ?{}(card_table_t* this)
     20static inline void ctor_card(card_table_t* const this)
    2121{
    2222        this->count = 0;
    2323}
    2424
    25 static inline void ^?{}(card_table_t* this)
     25static inline void dtor_card(card_table_t* const this)
    2626{
    2727
  • src/examples/gc_no_raii/src/internal/memory_pool.c

    r9c23f31 r2298f728  
    1111const size_t gc_pool_header_size = (size_t)(  &(((gc_memory_pool*)NULL)->start_p) );
    1212
    13 void ?{}(gc_memory_pool* this, size_t size, gc_memory_pool* next, gc_memory_pool* mirror, uint8_t type)
     13void ctor(gc_memory_pool *const this, size_t size, gc_memory_pool* next, gc_memory_pool* mirror, uint8_t type)
    1414{
    1515        this->mirror = mirror;
     
    1717        this->type_code = type;
    1818
    19         this->cards = ( (card_table_t*)malloc(sizeof(card_table_t)) ){};
     19        card_table_t* new = (card_table_t*)malloc(sizeof(card_table_t));
     20        this->cards = new;
     21        ctor_card(this->cards);
    2022
    2123        this->end_p = ((uint8_t*)this) + size;
     
    2729}
    2830
    29 void ^?{}(gc_memory_pool* this)
     31void dtor(gc_memory_pool *const this)
    3032{
    31         ^(&this->cards){};
     33        dtor_card(this->cards);
    3234        free(this->cards);
    3335}
  • src/examples/gc_no_raii/src/internal/memory_pool.h

    r9c23f31 r2298f728  
    2727};
    2828
    29 void ?{}(       gc_memory_pool* this,
     29void ctor(      gc_memory_pool *const this,
    3030                size_t size,
    3131                gc_memory_pool* next,
     
    3434        );
    3535
    36 void ^?{}(gc_memory_pool* this);
     36void dtor(gc_memory_pool *const this);
    3737
    3838struct gc_pool_object_iterator
  • src/examples/gc_no_raii/src/internal/state.c

    r9c23f31 r2298f728  
    131131
    132132      this->from_space = (gc_memory_pool*)(pal_allocPool(POOL_SIZE_BYTES, 1));
    133       this->to_space   = (gc_memory_pool*)(pal_allocPool(POOL_SIZE_BYTES, 1));
    134 
    135       this->from_space{ POOL_SIZE_BYTES, old_from_space, this->to_space,   this->from_code };
    136       this->to_space  { POOL_SIZE_BYTES, old_to_space,   this->from_space, (~this->from_code) & 0x01 };
     133      this->to_space = (gc_memory_pool*)(pal_allocPool(POOL_SIZE_BYTES, 1));
     134
     135      ctor(this->from_space, POOL_SIZE_BYTES, old_from_space, this->to_space,   this->from_code);
     136      ctor(this->to_space,   POOL_SIZE_BYTES, old_to_space,   this->from_space, (~this->from_code) & 0x01);
    137137
    138138        this->total_space += gc_pool_size_used(this->from_space);
  • src/include/assert.h

    r9c23f31 r2298f728  
    2222#define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))
    2323
    24 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn));
     24void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... );
    2525
    2626template<typename T, typename U>
  • src/libcfa/containers/vector

    r9c23f31 r2298f728  
    2020}
    2121
     22#define DESTROY(x)
     23
    2224//------------------------------------------------------------------------------
    2325//Declaration
    2426trait allocator_c(otype T, otype allocator_t)
    2527{
    26         void realloc_storage(allocator_t*, size_t);
    27         T* data(allocator_t*);
     28        void ctor(allocator_t* const);
     29        void dtor(allocator_t* const);
     30        void realloc_storage(allocator_t* const, size_t);
     31        T* data(allocator_t* const);
    2832};
    29 
    30 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    31 struct vector;
    32 
    33 //------------------------------------------------------------------------------
    34 //Initialization
    35 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    36 void ?{}(vector(T, allocator_t)* this);
    37 
    38 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    39 void ?{}(vector(T, allocator_t)* this, vector(T, allocator_t) rhs);
    40 
    41 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    42 vector(T, allocator_t) ?=?(vector(T, allocator_t)* this, vector(T, allocator_t) rhs);
    43 
    44 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    45 void ^?{}(vector(T, allocator_t)* this);
    4633
    4734forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     
    5340
    5441//------------------------------------------------------------------------------
     42//Initialization
     43forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     44void ctor(vector(T, allocator_t) *const this);
     45
     46forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     47void dtor(vector(T, allocator_t) *const this);
     48
     49//------------------------------------------------------------------------------
    5550//Capacity
    5651forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    57 static inline bool empty(vector(T, allocator_t)* this)
     52static inline bool empty(vector(T, allocator_t) *const this)
    5853{
    5954        return this->size == 0;
     
    6156
    6257forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    63 static inline size_t size(vector(T, allocator_t)* this)
     58static inline size_t size(vector(T, allocator_t) *const this)
    6459{
    6560        return this->size;
     
    6762
    6863forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    69 static inline void reserve(vector(T, allocator_t)* this, size_t size)
     64static inline void reserve(vector(T, allocator_t) *const this, size_t size)
    7065{
    7166        realloc_storage(&this->storage, this->size+1);
     
    7570//Element access
    7671forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    77 static inline T at(vector(T, allocator_t)* this, size_t index)
     72static inline T at(vector(T, allocator_t) *const this, size_t index)
    7873{
    7974        return data(&this->storage)[index];
     
    8176
    8277forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    83 static inline T ?[?](vector(T, allocator_t)* this, size_t index)
     78static inline T ?[?](vector(T, allocator_t) *const this, size_t index)
    8479{
    8580        return data(&this->storage)[index];
     
    8782
    8883forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    89 static inline T front(vector(T, allocator_t)* this)
     84static inline T front(vector(T, allocator_t) *const this)
    9085{
    9186        return data(&this->storage)[0];
     
    9388
    9489forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    95 static inline T back(vector(T, allocator_t)* this)
     90static inline T back(vector(T, allocator_t) *const this)
    9691{
    9792        return data(&this->storage)[this->size - 1];
     
    10196//Modifiers
    10297forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    103 void push_back(vector(T, allocator_t)* this, T value);
     98void push_back(vector(T, allocator_t) *const this, T value);
    10499
    105100forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    106 void pop_back(vector(T, allocator_t)* this);
     101void pop_back(vector(T, allocator_t) *const this);
    107102
    108103forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    109 void clear(vector(T, allocator_t)* this);
     104void clear(vector(T, allocator_t) *const this);
    110105
    111106//------------------------------------------------------------------------------
    112107//Iterators
    113108forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    114 static inline T* begin(vector(T, allocator_t)* this)
     109static inline T* begin(vector(T, allocator_t) *const this)
    115110{
    116111        return data(&this->storage);
     
    118113
    119114forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    120 static inline const T* cbegin(const vector(T, allocator_t)* this)
     115static inline const T* cbegin(const vector(T, allocator_t) *const this)
    121116{
    122117        return data(&this->storage);
     
    124119
    125120forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    126 static inline T* end(vector(T, allocator_t)* this)
     121static inline T* end(vector(T, allocator_t) *const this)
    127122{
    128123        return data(&this->storage) + this->size;
     
    130125
    131126forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    132 static inline const T* cend(const vector(T, allocator_t)* this)
     127static inline const T* cend(const vector(T, allocator_t) *const this)
    133128{
    134129        return data(&this->storage) + this->size;
     
    145140
    146141forall(otype T)
    147 void ?{}(heap_allocator(T)* this);
     142void ctor(heap_allocator(T) *const this);
    148143
    149144forall(otype T)
    150 void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs);
     145void dtor(heap_allocator(T) *const this);
    151146
    152147forall(otype T)
    153 heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs);
     148void realloc_storage(heap_allocator(T) *const this, size_t size);
    154149
    155150forall(otype T)
    156 void ^?{}(heap_allocator(T)* this);
    157 
    158 forall(otype T)
    159 void realloc_storage(heap_allocator(T)* this, size_t size);
    160 
    161 forall(otype T)
    162 static inline T* data(heap_allocator(T)* this)
     151static inline T* data(heap_allocator(T) *const this)
    163152{
    164153        return this->storage;
  • src/libcfa/containers/vector.c

    r9c23f31 r2298f728  
    1818#include <stdlib>
    1919
    20 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    21 void copy_internal(vector(T, allocator_t)* this, vector(T, allocator_t)* other);
    22 
    2320//------------------------------------------------------------------------------
    2421//Initialization
    2522forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    26 void ?{}(vector(T, allocator_t)* this)
     23void ctor(vector(T, allocator_t) *const this)
    2724{
    28         (&this->storage){};
     25        ctor(&this->storage);
    2926        this->size = 0;
    3027}
    3128
    3229forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    33 void ?{}(vector(T, allocator_t)* this, vector(T, allocator_t) rhs)
    34 {
    35         (&this->storage){ rhs.storage };
    36         copy_internal(this, &rhs);
    37 }
    38 
    39 // forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    40 // vector(T, allocator_t) ?=?(vector(T, allocator_t)* this, vector(T, allocator_t) rhs)
    41 // {
    42 //      (&this->storage){};
    43 //      copy_internal(this, &rhs);
    44 //      return *this;
    45 // }
    46 
    47 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    48 void ^?{}(vector(T, allocator_t)* this)
     30void dtor(vector(T, allocator_t) *const this)
    4931{
    5032        clear(this);
    51         ^(&this->storage){};
     33        dtor(&this->storage);
    5234}
    5335
     
    5537//Modifiers
    5638forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    57 void push_back(vector(T, allocator_t)* this, T value)
     39void push_back(vector(T, allocator_t) *const this, T value)
    5840{
    5941        realloc_storage(&this->storage, this->size+1);
     
    6345
    6446forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    65 void pop_back(vector(T, allocator_t)* this)
     47void pop_back(vector(T, allocator_t) *const this)
    6648{
    6749        this->size--;
    68         ^(&data(&this->storage)[this->size]){};
     50        DESTROY(data(&this->storage)[this->size]);
    6951}
    7052
    7153forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    72 void clear(vector(T, allocator_t)* this)
     54void clear(vector(T, allocator_t) *const this)
    7355{
    7456        for(size_t i = 0; i < this->size; i++)
    7557        {
    76                 ^(&data(&this->storage)[this->size]){};
     58                DESTROY(data(&this->storage)[this->size]);
    7759        }
    7860        this->size = 0;
     
    8062
    8163//------------------------------------------------------------------------------
    82 //Internal Helpers
    83 
    84 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    85 void copy_internal(vector(T, allocator_t)* this, vector(T, allocator_t)* other)
    86 {
    87         this->size = other->size;
    88         for(size_t i = 0; i < this->size; i++) {
    89                 (&data(&this->storage)[this->size]){ data(&other->storage)[other->size] };
    90         }
    91 }
    92 
    93 //------------------------------------------------------------------------------
    9464//Allocator
    9565forall(otype T)
    96 void ?{}(heap_allocator(T)* this)
     66void ctor(heap_allocator(T) *const this)
    9767{
    9868        this->storage = 0;
     
    10171
    10272forall(otype T)
    103 void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs)
    104 {
    105         this->capacity = rhs.capacity;
    106         this->storage = (T*)realloc((void*)this->storage, this->capacity * sizeof(T));
    107 }
    108 
    109 forall(otype T)
    110 heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs)
    111 {
    112         this->capacity = rhs.capacity;
    113         this->storage = (T*)realloc((void*)this->storage, this->capacity * sizeof(T));
    114         return *this;
    115 }
    116 
    117 forall(otype T)
    118 void ^?{}(heap_allocator(T)* this)
     73void dtor(heap_allocator(T) *const this)
    11974{
    12075        free(this->storage);
     
    12277
    12378forall(otype T)
    124 inline void realloc_storage(heap_allocator(T)* this, size_t size)
     79inline void realloc_storage(heap_allocator(T) *const this, size_t size)
    12580{
    12681        enum { GROWTH_RATE = 2 };
  • src/libcfa/prelude.cf

    r9c23f31 r2298f728  
    636636
    637637// default ctor
    638 void    ?{}( _Bool * );
    639 void    ?{}( char * );
    640 void    ?{}( unsigned char * );
    641 void    ?{}( char signed * );
    642 void    ?{}( int short * );
    643 void    ?{}( int short unsigned * );
    644 void    ?{}( signed int * );
    645 void    ?{}( unsigned int * );
    646 void    ?{}( signed long int * );
    647 void    ?{}( unsigned long int * );
    648 void    ?{}( signed long long int * );
    649 void    ?{}( unsigned long long int * );
    650 void    ?{}( float * );
    651 void    ?{}( double * );
    652 void    ?{}( long double * );
    653 void    ?{}( float _Complex * );
    654 void    ?{}( double _Complex * );
    655 void    ?{}( long double _Complex * );
     638void    ?{}( _Bool * ),                         ?{}( volatile _Bool * );
     639void    ?{}( char * ),  ?{}( volatile char * );
     640void    ?{}( unsigned char * ), ?{}( volatile unsigned char * );
     641void    ?{}( char signed * ),                   ?{}( volatile char signed * );
     642void    ?{}( int short * ),                             ?{}( volatile int short * );
     643void    ?{}( int short unsigned * ),    ?{}( volatile int short unsigned * );
     644void    ?{}( signed int * ),                    ?{}( volatile signed int * );
     645void    ?{}( unsigned int * ),                  ?{}( volatile unsigned int * );
     646void    ?{}( signed long int * ),               ?{}( volatile signed long int * );
     647void    ?{}( unsigned long int * ),             ?{}( volatile unsigned long int * );
     648void    ?{}( signed long long int * ),          ?{}( volatile signed long long int * );
     649void    ?{}( unsigned long long int * ),        ?{}( volatile unsigned long long int * );
     650void    ?{}( float * ),                         ?{}( volatile float * );
     651void    ?{}( double * ),                        ?{}( volatile double * );
     652void    ?{}( long double * ),                   ?{}( volatile long double * );
     653void    ?{}( float _Complex * ),                ?{}( volatile float _Complex * );
     654void    ?{}( double _Complex * ),               ?{}( volatile double _Complex * );
     655void    ?{}( long double _Complex * ),          ?{}( volatile long double _Complex * );
    656656
    657657// copy ctor
    658 void    ?{}( _Bool *, _Bool );
    659 void    ?{}( char *, char );
    660 void    ?{}( unsigned char *, unsigned char );
    661 void    ?{}( char signed *, char signed );
    662 void    ?{}( int short *, int short );
    663 void    ?{}( int short unsigned *, int short unsigned );
    664 void    ?{}( signed int *, signed int);
    665 void    ?{}( unsigned int *, unsigned int);
    666 void    ?{}( signed long int *, signed long int);
    667 void    ?{}( unsigned long int *, unsigned long int);
    668 void    ?{}( signed long long int *, signed long long int);
    669 void    ?{}( unsigned long long int *, unsigned long long int);
    670 void    ?{}( float *, float);
    671 void    ?{}( double *, double);
    672 void    ?{}( long double *, long double);
    673 void    ?{}( float _Complex *, float _Complex);
    674 void    ?{}( double _Complex *, double _Complex);
    675 void    ?{}( long double _Complex *, long double _Complex);
     658void    ?{}( _Bool *, _Bool ),                                  ?{}( volatile _Bool *, _Bool );
     659void    ?{}( char *, char ),    ?{}( volatile char *, char );
     660void    ?{}( unsigned char *, unsigned char ),                  ?{}( volatile unsigned char *, unsigned char );
     661void    ?{}( char signed *, char signed ),                      ?{}( volatile char signed *, char signed );
     662void    ?{}( int short *, int short ),                          ?{}( volatile int short *, int short );
     663void    ?{}( int short unsigned *, int short unsigned ),        ?{}( volatile int short unsigned *, int short unsigned );
     664void    ?{}( signed int *, signed int),                         ?{}( volatile signed int *, signed int );
     665void    ?{}( unsigned int *, unsigned int),                     ?{}( volatile unsigned int *, unsigned int );
     666void    ?{}( signed long int *, signed long int),               ?{}( volatile signed long int *, signed long int );
     667void    ?{}( unsigned long int *, unsigned long int),           ?{}( volatile unsigned long int *, unsigned long int );
     668void    ?{}( signed long long int *, signed long long int),     ?{}( volatile signed long long int *, signed long long int );
     669void    ?{}( unsigned long long int *, unsigned long long int), ?{}( volatile unsigned long long int *, unsigned long long int );
     670void    ?{}( float *, float),                                   ?{}( volatile float *, float );
     671void    ?{}( double *, double),                                 ?{}( volatile double *, double );
     672void    ?{}( long double *, long double),                       ?{}( volatile long double *, long double );
     673void    ?{}( float _Complex *, float _Complex),                 ?{}( volatile float _Complex *, float _Complex );
     674void    ?{}( double _Complex *, double _Complex),               ?{}( volatile double _Complex *, double _Complex );
     675void    ?{}( long double _Complex *, long double _Complex),     ?{}( volatile long double _Complex *, long double _Complex );
    676676
    677677// dtor
    678 void    ^?{}( _Bool * );
    679 void    ^?{}( char * );
    680 void    ^?{}( char unsigned * );
    681 void    ^?{}( char signed * );
    682 void    ^?{}( int short * );
    683 void    ^?{}( int short unsigned * );
    684 void    ^?{}( signed int * );
    685 void    ^?{}( unsigned int * );
    686 void    ^?{}( signed long int * );
    687 void    ^?{}( unsigned long int * );
    688 void    ^?{}( signed long long int * );
    689 void    ^?{}( unsigned long long int * );
    690 void    ^?{}( float * );
    691 void    ^?{}( double * );
    692 void    ^?{}( long double * );
    693 void    ^?{}( float _Complex * );
    694 void    ^?{}( double _Complex * );
    695 void    ^?{}( long double _Complex * );
     678void    ^?{}( _Bool * ),                        ^?{}( volatile _Bool * );
     679void    ^?{}( char * ), ^?{}( volatile char * );
     680void    ^?{}( char unsigned * ),                        ^?{}( volatile char unsigned * );
     681void    ^?{}( char signed * ),                  ^?{}( volatile char signed * );
     682void    ^?{}( int short * ),                            ^?{}( volatile int short * );
     683void    ^?{}( int short unsigned * ),   ^?{}( volatile int short unsigned * );
     684void    ^?{}( signed int * ),                   ^?{}( volatile signed int * );
     685void    ^?{}( unsigned int * ),                 ^?{}( volatile unsigned int * );
     686void    ^?{}( signed long int * ),              ^?{}( volatile signed long int * );
     687void    ^?{}( unsigned long int * ),            ^?{}( volatile unsigned long int * );
     688void    ^?{}( signed long long int * ),         ^?{}( volatile signed long long int * );
     689void    ^?{}( unsigned long long int * ),       ^?{}( volatile unsigned long long int * );
     690void    ^?{}( float * ),                        ^?{}( volatile float * );
     691void    ^?{}( double * ),                       ^?{}( volatile double * );
     692void    ^?{}( long double * ),                  ^?{}( volatile long double * );
     693void    ^?{}( float _Complex * ),               ^?{}( volatile float _Complex * );
     694void    ^?{}( double _Complex * ),              ^?{}( volatile double _Complex * );
     695void    ^?{}( long double _Complex * ),         ^?{}( volatile long double _Complex * );
    696696
    697697// // default ctor
     
    719719
    720720forall( dtype DT ) void ?{}(                 DT *          *,                   DT * );
     721forall( dtype DT ) void ?{}(                 DT * volatile *,                   DT * );
    721722forall( dtype DT ) void ?{}( const           DT *          *,                   DT * );
     723forall( dtype DT ) void ?{}( const           DT * volatile *,                   DT * );
    722724forall( dtype DT ) void ?{}( const           DT *          *, const             DT * );
     725forall( dtype DT ) void ?{}( const           DT * volatile *, const             DT * );
    723726forall( dtype DT ) void ?{}(       volatile  DT *          *,                   DT * );
     727forall( dtype DT ) void ?{}(       volatile  DT * volatile *,                   DT * );
    724728forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    DT * );
     729forall( dtype DT ) void ?{}(       volatile  DT * volatile *,       volatile    DT * );
    725730
    726731forall( dtype DT ) void ?{}( const volatile  DT *          *,                   DT * );
     732forall( dtype DT ) void ?{}( const volatile  DT * volatile *,                   DT * );
    727733forall( dtype DT ) void ?{}( const volatile  DT *          *, const             DT * );
     734forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const             DT * );
    728735forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    DT * );
     736forall( dtype DT ) void ?{}( const volatile  DT * volatile *,       volatile    DT * );
    729737forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    DT * );
     738forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const volatile    DT * );
    730739
    731740forall( dtype DT ) void ?{}(                 DT *          *,                   void * );
     741forall( dtype DT ) void ?{}(                 DT * volatile *,                   void * );
    732742forall( dtype DT ) void ?{}( const           DT *          *,                   void * );
     743forall( dtype DT ) void ?{}( const           DT * volatile *,                   void * );
    733744forall( dtype DT ) void ?{}( const           DT *          *, const             void * );
     745forall( dtype DT ) void ?{}( const           DT * volatile *, const             void * );
    734746forall( dtype DT ) void ?{}(       volatile  DT *          *,                   void * );
     747forall( dtype DT ) void ?{}(       volatile  DT * volatile *,                   void * );
    735748forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    void * );
     749forall( dtype DT ) void ?{}(       volatile  DT * volatile *,       volatile    void * );
    736750
    737751forall( dtype DT ) void ?{}( const volatile  DT *          *,                   void * );
     752forall( dtype DT ) void ?{}( const volatile  DT * volatile *,                   void * );
    738753forall( dtype DT ) void ?{}( const volatile  DT *          *, const             void * );
     754forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const             void * );
    739755forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    void * );
     756forall( dtype DT ) void ?{}( const volatile  DT * volatile *,       volatile    void * );
    740757forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    void * );
     758forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const volatile    void * );
    741759
    742760forall( dtype DT ) void ?{}(                 void *          *,                 DT * );
     761forall( dtype DT ) void ?{}(                 void * volatile *,                 DT * );
    743762forall( dtype DT ) void ?{}( const           void *          *,                 DT * );
     763forall( dtype DT ) void ?{}( const           void * volatile *,                 DT * );
    744764forall( dtype DT ) void ?{}( const           void *          *, const           DT * );
     765forall( dtype DT ) void ?{}( const           void * volatile *, const           DT * );
    745766forall( dtype DT ) void ?{}(        volatile void *          *,                 DT * );
     767forall( dtype DT ) void ?{}(        volatile void * volatile *,                 DT * );
    746768forall( dtype DT ) void ?{}(        volatile void *          *,       volatile  DT * );
     769forall( dtype DT ) void ?{}(        volatile void * volatile *,       volatile  DT * );
    747770forall( dtype DT ) void ?{}( const volatile void *           *,                 DT * );
     771forall( dtype DT ) void ?{}( const volatile void * volatile *,                  DT * );
    748772forall( dtype DT ) void ?{}( const volatile void *           *, const           DT * );
     773forall( dtype DT ) void ?{}( const volatile void * volatile *, const            DT * );
    749774forall( dtype DT ) void ?{}( const volatile void *           *,       volatile  DT * );
     775forall( dtype DT ) void ?{}( const volatile void * volatile *,        volatile  DT * );
    750776forall( dtype DT ) void ?{}( const volatile void *           *, const volatile  DT * );
     777forall( dtype DT ) void ?{}( const volatile void * volatile *, const volatile   DT * );
    751778
    752779void    ?{}(                void *          *,                void * );
     780void    ?{}(                void * volatile *,                void * );
    753781void    ?{}( const          void *          *,                void * );
     782void    ?{}( const          void * volatile *,                void * );
    754783void    ?{}( const          void *          *, const          void * );
     784void    ?{}( const          void * volatile *, const          void * );
    755785void    ?{}(       volatile void *          *,                void * );
     786void    ?{}(       volatile void * volatile *,                void * );
    756787void    ?{}(       volatile void *          *,       volatile void * );
     788void    ?{}(       volatile void * volatile *,       volatile void * );
    757789void    ?{}( const volatile void *          *,                void * );
     790void    ?{}( const volatile void * volatile *,                void * );
    758791void    ?{}( const volatile void *          *, const          void * );
     792void    ?{}( const volatile void * volatile *, const          void * );
    759793void    ?{}( const volatile void *          *,       volatile void * );
     794void    ?{}( const volatile void * volatile *,       volatile void * );
    760795void    ?{}( const volatile void *          *, const volatile void * );
     796void    ?{}( const volatile void * volatile *, const volatile void * );
    761797
    762798//forall( dtype DT ) void ?{}(              DT *          *, forall( dtype DT2 ) const DT2 * );
    763799//forall( dtype DT ) void ?{}(              DT * volatile *, forall( dtype DT2 ) const DT2 * );
    764800forall( dtype DT ) void ?{}( const          DT *          *, forall( dtype DT2 ) const DT2 * );
     801forall( dtype DT ) void ?{}( const          DT * volatile *, forall( dtype DT2 ) const DT2 * );
    765802//forall( dtype DT ) void ?{}( volatile     DT *          *, forall( dtype DT2 ) const DT2 * );
    766803//forall( dtype DT ) void ?{}( volatile     DT * volatile *, forall( dtype DT2 ) const DT2 * );
    767804forall( dtype DT ) void ?{}( const volatile DT *          *, forall( dtype DT2 ) const DT2 * );
     805forall( dtype DT ) void ?{}( const volatile DT * volatile *, forall( dtype DT2 ) const DT2 * );
    768806
    769807forall( ftype FT ) void ?{}( FT *          *, forall( ftype FT2 ) FT2 * );
     808forall( ftype FT ) void ?{}( FT * volatile *, forall( ftype FT2 ) FT2 * );
    770809
    771810// default ctors
    772811forall( ftype FT ) void ?{}( FT *          * );
     812forall( ftype FT ) void ?{}( FT * volatile * );
    773813
    774814forall( dtype DT ) void ?{}(                 DT *          *);
     815forall( dtype DT ) void ?{}(                 DT * volatile *);
    775816forall( dtype DT ) void ?{}( const           DT *          *);
     817forall( dtype DT ) void ?{}( const           DT * volatile *);
    776818forall( dtype DT ) void ?{}(       volatile  DT *          *);
     819forall( dtype DT ) void ?{}(       volatile  DT * volatile *);
    777820forall( dtype DT ) void ?{}( const volatile  DT *          *);
     821forall( dtype DT ) void ?{}( const volatile  DT * volatile *);
    778822
    779823void    ?{}(                void *          *);
     824void    ?{}(                void * volatile *);
    780825void    ?{}( const          void *          *);
     826void    ?{}( const          void * volatile *);
    781827void    ?{}(       volatile void *          *);
     828void    ?{}(       volatile void * volatile *);
    782829void    ?{}( const volatile void *          *);
     830void    ?{}( const volatile void * volatile *);
    783831
    784832// dtors
    785833forall( ftype FT ) void ^?{}( FT *         * );
     834forall( ftype FT ) void ^?{}( FT * volatile * );
    786835
    787836forall( dtype DT ) void ^?{}(                DT *          *);
     837forall( dtype DT ) void ^?{}(                DT * volatile *);
    788838forall( dtype DT ) void ^?{}( const          DT *          *);
     839forall( dtype DT ) void ^?{}( const          DT * volatile *);
    789840forall( dtype DT ) void ^?{}(      volatile  DT *          *);
     841forall( dtype DT ) void ^?{}(      volatile  DT * volatile *);
    790842forall( dtype DT ) void ^?{}( const volatile  DT *         *);
     843forall( dtype DT ) void ^?{}( const volatile  DT * volatile *);
    791844
    792845void    ^?{}(               void *          *);
     846void    ^?{}(               void * volatile *);
    793847void    ^?{}( const         void *          *);
     848void    ^?{}( const         void * volatile *);
    794849void    ^?{}(      volatile void *          *);
     850void    ^?{}(      volatile void * volatile *);
    795851void    ^?{}( const volatile void *         *);
     852void    ^?{}( const volatile void * volatile *);
    796853
    797854// Local Variables: //
  • src/tests/libcfa_vector.c

    r9c23f31 r2298f728  
    1 //
     1// 
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 //
    7 // libcfa_vector.c --
    8 //
     6// 
     7// libcfa_vector.c -- 
     8// 
    99// Author           : Thierry Delisle
    1010// Created On       : Mon Jul  4 23:36:19 2016
     
    1212// Last Modified On : Tue Jul  5 15:08:05 2016
    1313// Update Count     : 26
    14 //
     14// 
    1515
    1616#include <fstream>
     
    2828int main() {
    2929        vector( int, heap_allocator(int) ) iv;
     30        ctor( &iv );
    3031
    3132        assert( empty( &iv ) );
Note: See TracChangeset for help on using the changeset viewer.