Changeset fcd17b2f


Ignore:
Timestamp:
Jul 27, 2017, 2:56:39 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
874960b
Parents:
4d4e5de (diff), a04ce4d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
8 added
27 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/lstlang.sty

    r4d4e5de rfcd17b2f  
    88%% Created On       : Sat May 13 16:34:42 2017
    99%% Last Modified By : Peter A. Buhr
    10 %% Last Modified On : Wed Jul 12 22:42:09 2017
    11 %% Update Count     : 12
     10%% Last Modified On : Mon Jul 24 20:40:37 2017
     11%% Update Count     : 13
    1212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1313
     
    112112                finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, _Noreturn, one_t,
    113113                otype, restrict, _Static_assert, throw, throwResume, trait, try, ttype, typeof, __typeof,
    114                 __typeof__, with, zero_t},
     114                __typeof__, virtual, with, zero_t},
    115115        morekeywords=[2]{
    116116                _Atomic, coroutine, is_coroutine, is_monitor, is_thread, monitor, mutex, nomutex,
  • src/CodeGen/CodeGenerator.cc

    r4d4e5de rfcd17b2f  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Jun  8 16:00:00 2017
    13 // Update Count     : 485
     12// Last Modified On : Tus Jul 25 15:29:00 2017
     13// Update Count     : 486
    1414//
    1515#include "CodeGenerator.h"
     
    594594        }
    595595
     596        void CodeGenerator::visit( VirtualCastExpr * castExpr ) {
     597                assertf( ! genC, "VirtualCastExpr should not reach code generation." );
     598                extension( castExpr );
     599                output << "(virtual ";
     600                castExpr->get_arg()->accept( *this );
     601                output << ")";
     602        }
     603
    596604        void CodeGenerator::visit( UntypedMemberExpr * memberExpr ) {
    597605                assertf( ! genC, "UntypedMemberExpr should not reach code generation." );
  • src/CodeGen/CodeGenerator.h

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:16:21 2017
    13 // Update Count     : 53
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Jul 25 25:30:00 2017
     13// Update Count     : 54
    1414//
    1515
     
    5959                virtual void visit( AddressExpr *addressExpr );
    6060                virtual void visit( CastExpr *castExpr );
     61                virtual void visit( VirtualCastExpr *castExpr );
    6162                virtual void visit( UntypedMemberExpr *memberExpr );
    6263                virtual void visit( MemberExpr *memberExpr );
  • src/Common/PassVisitor.h

    r4d4e5de rfcd17b2f  
    8181        virtual void visit( NameExpr *nameExpr ) override final;
    8282        virtual void visit( CastExpr *castExpr ) override final;
     83        virtual void visit( VirtualCastExpr *castExpr ) override final;
    8384        virtual void visit( AddressExpr *addressExpr ) override final;
    8485        virtual void visit( LabelAddressExpr *labAddressExpr ) override final;
     
    168169        virtual Expression* mutate( LabelAddressExpr *labAddressExpr ) override final;
    169170        virtual Expression* mutate( CastExpr *castExpr ) override final;
     171        virtual Expression* mutate( VirtualCastExpr *castExpr ) override final;
    170172        virtual Expression* mutate( UntypedMemberExpr *memberExpr ) override final;
    171173        virtual Expression* mutate( MemberExpr *memberExpr ) override final;
  • src/Common/PassVisitor.impl.h

    r4d4e5de rfcd17b2f  
    607607
    608608template< typename pass_type >
     609void PassVisitor< pass_type >::visit( VirtualCastExpr * node ) {
     610        VISIT_BODY( node );
     611}
     612
     613template< typename pass_type >
    609614void PassVisitor< pass_type >::visit( AddressExpr * node ) {
    610615        VISIT_BODY( node );
     
    979984
    980985template< typename pass_type >
     986Expression * PassVisitor< pass_type >::mutate( VirtualCastExpr * node ) {
     987        MUTATE_BODY( Expression, node );
     988}
     989
     990template< typename pass_type >
    981991Expression * PassVisitor< pass_type >::mutate( UntypedMemberExpr * node ) {
    982992        MUTATE_BODY( Expression, node );
  • src/GenPoly/Box.cc

    r4d4e5de rfcd17b2f  
    17501750
    17511751                Expression *PolyGenericCalculator::mutate( SizeofExpr *sizeofExpr ) {
    1752                         Type *ty = sizeofExpr->get_type();
     1752                        Type *ty = sizeofExpr->get_isType() ? sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result();
    17531753                        if ( findGeneric( ty ) ) {
    17541754                                Expression *ret = new NameExpr( sizeofName( mangleType( ty ) ) );
     
    17601760
    17611761                Expression *PolyGenericCalculator::mutate( AlignofExpr *alignofExpr ) {
    1762                         Type *ty = alignofExpr->get_type();
     1762                        Type *ty = alignofExpr->get_isType() ? alignofExpr->get_type() : alignofExpr->get_expr()->get_result();
    17631763                        if ( findGeneric( ty ) ) {
    17641764                                Expression *ret = new NameExpr( alignofName( mangleType( ty ) ) );
  • src/Makefile.am

    r4d4e5de rfcd17b2f  
    1010## Author           : Peter A. Buhr
    1111## Created On       : Sun May 31 08:51:46 2015
    12 ## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Oct 27 20:41:25 2016
    14 ## Update Count     : 75
     12## Last Modified By : Andrew Beach
     13## Last Modified On : Tus Jul 25 10:34:00 2017
     14## Update Count     : 76
    1515###############################################################################
    1616
     
    3737include SynTree/module.mk
    3838include Tuples/module.mk
     39include Virtual/module.mk
    3940
    4041# put into lib for now
  • src/Makefile.in

    r4d4e5de rfcd17b2f  
    2323#SRC +=  ArgTweak/Rewriter.cc \
    2424#       ArgTweak/Mutate.cc
     25
     26######################### -*- Mode: Makefile-Gmake -*- ########################
     27###############################################################################
    2528
    2629######################### -*- Mode: Makefile-Gmake -*- ########################
     
    255258        Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) \
    256259        Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT) \
    257         Tuples/driver_cfa_cpp-Explode.$(OBJEXT)
     260        Tuples/driver_cfa_cpp-Explode.$(OBJEXT) \
     261        Virtual/driver_cfa_cpp-ExpandCasts.$(OBJEXT)
    258262am_driver_cfa_cpp_OBJECTS = $(am__objects_1)
    259263driver_cfa_cpp_OBJECTS = $(am_driver_cfa_cpp_OBJECTS)
     
    355359        $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk \
    356360        $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk \
    357         $(srcdir)/Tuples/module.mk $(top_srcdir)/automake/depcomp \
    358         $(top_srcdir)/automake/ylwrap Parser/lex.cc Parser/parser.cc \
    359         Parser/parser.hh
     361        $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk \
     362        $(top_srcdir)/automake/depcomp $(top_srcdir)/automake/ylwrap \
     363        Parser/lex.cc Parser/parser.cc Parser/parser.hh
    360364DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    361365ACLOCAL = @ACLOCAL@
     
    533537        SynTree/Attribute.cc SynTree/VarExprReplacer.cc \
    534538        Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
    535         Tuples/Explode.cc
     539        Tuples/Explode.cc Virtual/ExpandCasts.cc
    536540MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \
    537541        ${cfa_cpplib_PROGRAMS}}
     
    552556.SUFFIXES:
    553557.SUFFIXES: .cc .ll .o .obj .yy
    554 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps)
     558$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
    555559        @for dep in $?; do \
    556560          case '$(am__configure_deps)' in \
     
    572576            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    573577        esac;
    574 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__empty):
     578$(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
    575579
    576580$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    941945Tuples/driver_cfa_cpp-Explode.$(OBJEXT): Tuples/$(am__dirstamp) \
    942946        Tuples/$(DEPDIR)/$(am__dirstamp)
     947Virtual/$(am__dirstamp):
     948        @$(MKDIR_P) Virtual
     949        @: > Virtual/$(am__dirstamp)
     950Virtual/$(DEPDIR)/$(am__dirstamp):
     951        @$(MKDIR_P) Virtual/$(DEPDIR)
     952        @: > Virtual/$(DEPDIR)/$(am__dirstamp)
     953Virtual/driver_cfa_cpp-ExpandCasts.$(OBJEXT): Virtual/$(am__dirstamp) \
     954        Virtual/$(DEPDIR)/$(am__dirstamp)
    943955driver/$(am__dirstamp):
    944956        @$(MKDIR_P) driver
     
    963975        -rm -f SynTree/*.$(OBJEXT)
    964976        -rm -f Tuples/*.$(OBJEXT)
     977        -rm -f Virtual/*.$(OBJEXT)
    965978
    966979distclean-compile:
     
    10781091@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@
    10791092@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po@am__quote@
     1093@AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po@am__quote@
    10801094
    10811095.cc.o:
     
    26482662@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    26492663@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-Explode.obj `if test -f 'Tuples/Explode.cc'; then $(CYGPATH_W) 'Tuples/Explode.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Explode.cc'; fi`
     2664
     2665Virtual/driver_cfa_cpp-ExpandCasts.o: Virtual/ExpandCasts.cc
     2666@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Virtual/driver_cfa_cpp-ExpandCasts.o -MD -MP -MF Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo -c -o Virtual/driver_cfa_cpp-ExpandCasts.o `test -f 'Virtual/ExpandCasts.cc' || echo '$(srcdir)/'`Virtual/ExpandCasts.cc
     2667@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po
     2668@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Virtual/ExpandCasts.cc' object='Virtual/driver_cfa_cpp-ExpandCasts.o' libtool=no @AMDEPBACKSLASH@
     2669@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2670@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Virtual/driver_cfa_cpp-ExpandCasts.o `test -f 'Virtual/ExpandCasts.cc' || echo '$(srcdir)/'`Virtual/ExpandCasts.cc
     2671
     2672Virtual/driver_cfa_cpp-ExpandCasts.obj: Virtual/ExpandCasts.cc
     2673@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Virtual/driver_cfa_cpp-ExpandCasts.obj -MD -MP -MF Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo -c -o Virtual/driver_cfa_cpp-ExpandCasts.obj `if test -f 'Virtual/ExpandCasts.cc'; then $(CYGPATH_W) 'Virtual/ExpandCasts.cc'; else $(CYGPATH_W) '$(srcdir)/Virtual/ExpandCasts.cc'; fi`
     2674@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po
     2675@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Virtual/ExpandCasts.cc' object='Virtual/driver_cfa_cpp-ExpandCasts.obj' libtool=no @AMDEPBACKSLASH@
     2676@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2677@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Virtual/driver_cfa_cpp-ExpandCasts.obj `if test -f 'Virtual/ExpandCasts.cc'; then $(CYGPATH_W) 'Virtual/ExpandCasts.cc'; else $(CYGPATH_W) '$(srcdir)/Virtual/ExpandCasts.cc'; fi`
    26502678
    26512679.ll.cc:
     
    27962824        -rm -f Tuples/$(DEPDIR)/$(am__dirstamp)
    27972825        -rm -f Tuples/$(am__dirstamp)
     2826        -rm -f Virtual/$(DEPDIR)/$(am__dirstamp)
     2827        -rm -f Virtual/$(am__dirstamp)
    27982828        -rm -f driver/$(am__dirstamp)
    27992829
     
    28112841
    28122842distclean: distclean-am
    2813         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
     2843        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Virtual/$(DEPDIR)
    28142844        -rm -f Makefile
    28152845distclean-am: clean-am distclean-compile distclean-generic \
     
    28572887
    28582888maintainer-clean: maintainer-clean-am
    2859         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
     2889        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Virtual/$(DEPDIR)
    28602890        -rm -f Makefile
    28612891maintainer-clean-am: distclean-am maintainer-clean-generic
  • src/Parser/ExpressionNode.cc

    r4d4e5de rfcd17b2f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:17:07 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Tus Jul 18 10:08:00 2017
    13 // Update Count     : 550
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 27 12:10:10 2017
     13// Update Count     : 556
    1414//
    1515
     
    6262        bool dec = true, Unsigned = false;                                      // decimal, unsigned constant
    6363        int size;                                                                                       // 0 => int, 1 => long, 2 => long long
    64         unsigned long long int v;                                                               // converted integral value
     64        unsigned long long int v;                                                       // converted integral value
    6565        size_t last = str.length() - 1;                                         // last character of constant
    66 
     66        Expression * ret;
     67
     68        // special constants
     69        if ( str == "0" ) {
     70                ret = new ConstantExpr( Constant( (Type *)new ZeroType( noQualifiers ), str, (unsigned long long int)0 ) );
     71                goto CLEANUP;
     72        } // if
     73        if ( str == "1" ) {
     74                ret = new ConstantExpr( Constant( (Type *)new OneType( noQualifiers ), str, (unsigned long long int)1 ) );
     75                goto CLEANUP;
     76        } // if
     77       
    6778        if ( str[0] == '0' ) {                                                          // octal/hex constant ?
    6879                dec = false;
     
    118129        } // if
    119130
    120         Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) );
     131        ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) );
     132  CLEANUP:
    121133        delete &str;                                                                            // created by lex
    122134        return ret;
     
    174186        return ret;
    175187} // build_constantStr
    176 
    177 Expression *build_constantZeroOne( const std::string & str ) {
    178         Expression * ret = new ConstantExpr( Constant( str == "0" ? (Type *)new ZeroType( noQualifiers ) : (Type*)new OneType( noQualifiers ), str,
    179                                                                                                    str == "0" ? (unsigned long long int)0 : (unsigned long long int)1 ) );
    180         delete &str;                                                                            // created by lex
    181         return ret;
    182 } // build_constantChar
    183188
    184189Expression * build_field_name_FLOATINGconstant( const std::string & str ) {
     
    252257}
    253258
     259
     260Expression *build_virtual_cast( DeclarationNode *decl_node, ExpressionNode *expr_node ) {
     261        Type *targetType = maybeMoveBuildType( decl_node );
     262        Expression *castArg = maybeMoveBuild< Expression >( expr_node );
     263        return new VirtualCastExpr( castArg, targetType );
     264}
     265
    254266Expression *build_fieldSel( ExpressionNode *expr_node, Expression *member ) {
    255267        UntypedMemberExpr *ret = new UntypedMemberExpr( member, maybeMoveBuild< Expression >(expr_node) );
  • src/Parser/ParseNode.h

    r4d4e5de rfcd17b2f  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:32:30 2017
    13 // Update Count     : 786
     12// Last Modified On : Thu Jul 27 12:08:08 2017
     13// Update Count     : 788
    1414//
    1515
     
    159159Expression * build_constantFloat( const std::string &str );
    160160Expression * build_constantChar( const std::string &str );
    161 Expression * build_constantZeroOne( const std::string &str );
    162161ConstantExpr * build_constantStr( const std::string &str );
    163162Expression * build_field_name_FLOATINGconstant( const std::string & str );
     
    170169
    171170Expression * build_cast( DeclarationNode * decl_node, ExpressionNode * expr_node );
     171Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node );
    172172Expression * build_fieldSel( ExpressionNode * expr_node, Expression * member );
    173173Expression * build_pfieldSel( ExpressionNode * expr_node, Expression * member );
  • src/Parser/lex.ll

    r4d4e5de rfcd17b2f  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Mon Jul 24 08:27:23 2017
    13  * Update Count     : 545
     12 * Last Modified On : Thu Jul 27 12:05:50 2017
     13 * Update Count     : 549
    1414 */
    1515
     
    288288
    289289                                /* numeric constants */
    290 "0"                             { NUMERIC_RETURN(ZERO); }                               // CFA
    291 "1"                             { NUMERIC_RETURN(ONE); }                                // CFA
    292290{decimal_constant} { NUMERIC_RETURN(INTEGERconstant); }
    293291{octal_constant} { NUMERIC_RETURN(INTEGERconstant); }
  • src/Parser/parser.yy

    r4d4e5de rfcd17b2f  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul 24 09:01:14 2017
    13 // Update Count     : 2463
     12// Last Modified On : Thu Jul 27 12:08:08 2017
     13// Update Count     : 2467
    1414//
    1515
     
    142142// converted into the tuple index (.)(1). e.g., 3.x
    143143%token<tok>     REALDECIMALconstant     REALFRACTIONconstant    FLOATINGconstant
    144 %token<tok> ZERO                                ONE                                             // CFA
    145144
    146145// multi-character operators
     
    159158%token ATassign                                                                                 // @=
    160159
    161 %type<tok> identifier  no_attr_identifier  zero_one
     160%type<tok> identifier  no_attr_identifier
    162161%type<tok> identifier_or_type_name  no_attr_identifier_or_type_name  attr_name
    163162%type<constant> string_literal
     
    360359        ;
    361360
    362 zero_one:                                                                                               // CFA
    363         ZERO
    364         | ONE
    365         ;
    366 
    367361string_literal:
    368362        string_literal_list                                                     { $$ = build_constantStr( *$1 ); }
     
    384378        IDENTIFIER                                                                                      // typedef name cannot be used as a variable name
    385379                { $$ = new ExpressionNode( build_varref( $1 ) ); }
    386         | zero_one
    387                 { $$ = new ExpressionNode( build_constantZeroOne( *$1 ) ); }
    388380        | tuple
    389381        | '(' comma_expression ')'
     
    484476                {
    485477                        $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) );
    486                 }
    487         | zero_one fraction_constants
    488                 {
    489                         $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantZeroOne( *$1 ), $2 ) );
    490478                }
    491479        ;
     
    573561                // VIRTUAL cannot be opt because of look ahead issues
    574562        | '(' VIRTUAL ')' cast_expression
    575                 { $$ = new ExpressionNode( build_cast( nullptr, $4 ) ); }
     563                { $$ = new ExpressionNode( build_virtual_cast( nullptr, $4 ) ); }
    576564        | '(' VIRTUAL type_no_function ')' cast_expression
    577                 { $$ = new ExpressionNode( build_cast( $3, $5 ) ); }
     565                { $$ = new ExpressionNode( build_virtual_cast( $3, $5 ) ); }
    578566//      | '(' type_no_function ')' tuple
    579567//              { $$ = new ExpressionNode( build_cast( $2, $4 ) ); }
  • src/ResolvExpr/AlternativeFinder.cc

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 23:52:08 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 09:14:17 2017
    13 // Update Count     : 30
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jul 26 11:33:00 2017
     13// Update Count     : 31
    1414//
    1515
     
    878878        }
    879879
     880        void AlternativeFinder::visit( VirtualCastExpr * castExpr ) {
     881                assertf( castExpr->get_result(), "Implicate virtual cast targets not yet supported." );
     882                AlternativeFinder finder( indexer, env );
     883                // don't prune here, since it's guaranteed all alternatives will have the same type
     884                // (giving the alternatives different types is half of the point of ConstructorExpr nodes)
     885                finder.findWithAdjustment( castExpr->get_arg(), false );
     886                for ( Alternative & alt : finder.alternatives ) {
     887                        alternatives.push_back( Alternative(
     888                                new VirtualCastExpr( alt.expr->clone(), castExpr->get_result()->clone() ),
     889                                alt.env, alt.cost ) );
     890                }
     891        }
     892
    880893        void AlternativeFinder::visit( UntypedMemberExpr *memberExpr ) {
    881894                AlternativeFinder funcFinder( indexer, env );
  • src/ResolvExpr/AlternativeFinder.h

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 23:56:12 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:35:32 2017
    13 // Update Count     : 3
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jul 26 11:24:00 2017
     13// Update Count     : 4
    1414//
    1515
     
    4949                virtual void visit( AddressExpr *addressExpr );
    5050                virtual void visit( CastExpr *castExpr );
     51                virtual void visit( VirtualCastExpr *castExpr );
    5152                virtual void visit( UntypedMemberExpr *memberExpr );
    5253                virtual void visit( MemberExpr *memberExpr );
  • src/SynTree/ApplicationExpr.cc

    r4d4e5de rfcd17b2f  
    4444}
    4545
    46 ApplicationExpr::ApplicationExpr( Expression *funcExpr ) : function( funcExpr ) {
     46ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list< Expression * > & argList ) : function( funcExpr ), args( argList ) {
    4747        PointerType *pointer = safe_dynamic_cast< PointerType* >( funcExpr->get_result() );
    4848        FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
  • src/SynTree/Expression.cc

    r4d4e5de rfcd17b2f  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 30 16:41:13 2017
    13 // Update Count     : 52
     12// Last Modified On : Tue Jul 25 14:15:47 2017
     13// Update Count     : 54
    1414//
    1515
     
    298298        if ( result->isVoid() ) {
    299299                os << "nothing";
     300        } else {
     301                result->print( os, indent+2 );
     302        } // if
     303        os << std::endl;
     304        Expression::print( os, indent );
     305}
     306
     307VirtualCastExpr::VirtualCastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) {
     308        set_result(toType);
     309}
     310
     311VirtualCastExpr::VirtualCastExpr( const VirtualCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) {
     312}
     313
     314VirtualCastExpr::~VirtualCastExpr() {
     315        delete arg;
     316}
     317
     318void VirtualCastExpr::print( std::ostream &os, int indent ) const {
     319        os << "Virtual Cast of:" << std::endl << std::string( indent+2, ' ' );
     320        arg->print(os, indent+2);
     321        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
     322        os << std::string( indent+2, ' ' );
     323        if ( ! result ) {
     324                os << "unknown";
    300325        } else {
    301326                result->print( os, indent+2 );
  • src/SynTree/Expression.h

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:53:16 2017
    13 // Update Count     : 42
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jul 24 16:27:00 2017
     13// Update Count     : 43
    1414//
    1515
     
    7979class ApplicationExpr : public Expression {
    8080  public:
    81         ApplicationExpr( Expression * function );
     81        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
    8282        ApplicationExpr( const ApplicationExpr & other );
    8383        virtual ~ApplicationExpr();
     
    194194
    195195        Expression * get_arg() const { return arg; }
    196         void set_arg(Expression * newValue ) { arg = newValue; }
     196        void set_arg( Expression * newValue ) { arg = newValue; }
    197197
    198198        virtual CastExpr * clone() const { return new CastExpr( * this ); }
     199        virtual void accept( Visitor & v ) { v.visit( this ); }
     200        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     201        virtual void print( std::ostream & os, int indent = 0 ) const;
     202  private:
     203        Expression * arg;
     204};
     205
     206/// VirtualCastExpr repersents a virtual dynamic cast, e.g. (virtual exception)e
     207class VirtualCastExpr : public Expression {
     208  public:
     209        VirtualCastExpr( Expression * arg, Type * toType );
     210        VirtualCastExpr( const VirtualCastExpr & other );
     211        virtual ~VirtualCastExpr();
     212
     213        Expression * get_arg() const { return arg; }
     214        void set_arg( Expression * newValue ) { arg = newValue; }
     215
     216        virtual VirtualCastExpr * clone() const { return new VirtualCastExpr( * this ); }
    199217        virtual void accept( Visitor & v ) { v.visit( this ); }
    200218        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
  • src/SynTree/Mutator.cc

    r4d4e5de rfcd17b2f  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Jun 22 13:43:00 2017
    13 // Update Count     : 24
     12// Last Modified On : Mon Jul 24 16:32:00 2017
     13// Update Count     : 25
    1414//
    1515
     
    235235}
    236236
     237Expression *Mutator::mutate( VirtualCastExpr *castExpr ) {
     238        castExpr->set_env( maybeMutate( castExpr->get_env(), *this ) );
     239        castExpr->set_result( maybeMutate( castExpr->get_result(), *this ) );
     240        castExpr->set_arg( maybeMutate( castExpr->get_arg(), *this ) );
     241        return castExpr;
     242}
     243
    237244Expression *Mutator::mutate( UntypedMemberExpr *memberExpr ) {
    238245        memberExpr->set_env( maybeMutate( memberExpr->get_env(), *this ) );
  • src/SynTree/Mutator.h

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:51:30 2017
    13 // Update Count     : 15
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jul 24 16:31:00 2017
     13// Update Count     : 16
    1414//
    1515#include <cassert>
     
    5959        virtual Expression* mutate( LabelAddressExpr *labAddressExpr );
    6060        virtual Expression* mutate( CastExpr *castExpr );
     61        virtual Expression* mutate( VirtualCastExpr *castExpr );
    6162        virtual Expression* mutate( UntypedMemberExpr *memberExpr );
    6263        virtual Expression* mutate( MemberExpr *memberExpr );
  • src/SynTree/SynTree.h

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:51:46 2017
    13 // Update Count     : 10
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jul 24 16:54:00 2017
     13// Update Count     : 11
    1414//
    1515
     
    6666class LabelAddressExpr;
    6767class CastExpr;
     68class VirtualCastExpr;
    6869class MemberExpr;
    6970class UntypedMemberExpr;
  • src/SynTree/Visitor.cc

    r4d4e5de rfcd17b2f  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Jun 22 13:41:00 2017
    13 // Update Count     : 26
     12// Last Modified On : Mon Jul 24 16:30:00 2017
     13// Update Count     : 27
    1414//
    1515
     
    192192}
    193193
     194void Visitor::visit( VirtualCastExpr *castExpr ) {
     195        maybeAccept( castExpr->get_result(), *this );
     196        maybeAccept( castExpr->get_arg(), *this );
     197}
     198
    194199void Visitor::visit( UntypedMemberExpr *memberExpr ) {
    195200        maybeAccept( memberExpr->get_result(), *this );
  • src/SynTree/Visitor.h

    r4d4e5de rfcd17b2f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:54:04 2017
    13 // Update Count     : 12
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jul 24 16:28:00 2017
     13// Update Count     : 13
    1414//
    1515
     
    6060        virtual void visit( NameExpr *nameExpr );
    6161        virtual void visit( CastExpr *castExpr );
     62        virtual void visit( VirtualCastExpr *castExpr );
    6263        virtual void visit( AddressExpr *addressExpr );
    6364        virtual void visit( LabelAddressExpr *labAddressExpr );
  • src/libcfa/Makefile.am

    r4d4e5de rfcd17b2f  
    1010## Author           : Peter A. Buhr
    1111## Created On       : Sun May 31 08:54:01 2015
    12 ## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Jul 20 23:09:34 2017
    14 ## Update Count     : 220
     12## Last Modified By : Andrew Beach
     13## Last Modified On : Wed Jul 26 14:15:00 2017
     14## Update Count     : 221
    1515###############################################################################
    1616
     
    5656libobjs = ${headers:=.o}
    5757libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \
    58          assert.c exception.c typeobject.c
     58         assert.c exception.c virtual.c
    5959
    6060# not all platforms support concurrency, add option do disable it
     
    7373        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    7474
    75 libcfa_a-typeobject.o : typeobject.c
     75libcfa_a-virtual.o : virtual.c
    7676        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    7777
     
    8282        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    8383
    84 libcfa_d_a-typeobject.o : typeobject.c
     84libcfa_d_a-virtual.o : virtual.c
    8585        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    8686
  • src/libcfa/Makefile.in

    r4d4e5de rfcd17b2f  
    154154        concurrency/coroutine.c concurrency/thread.c \
    155155        concurrency/kernel.c concurrency/monitor.c assert.c \
    156         exception.c typeobject.c \
    157         concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \
    158         concurrency/invoke.c concurrency/preemption.c
     156        exception.c virtual.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
     157        concurrency/alarm.c concurrency/invoke.c \
     158        concurrency/preemption.c
    159159am__dirstamp = $(am__leading_dot)dirstamp
    160160@BUILD_CONCURRENCY_TRUE@am__objects_1 = concurrency/libcfa_d_a-coroutine.$(OBJEXT) \
     
    178178        libhdr/libcfa_d_a-libdebug.$(OBJEXT) $(am__objects_2) \
    179179        libcfa_d_a-assert.$(OBJEXT) libcfa_d_a-exception.$(OBJEXT) \
    180         libcfa_d_a-typeobject.$(OBJEXT) $(am__objects_3)
     180        libcfa_d_a-virtual.$(OBJEXT) $(am__objects_3)
    181181am_libcfa_d_a_OBJECTS = $(am__objects_4)
    182182libcfa_d_a_OBJECTS = $(am_libcfa_d_a_OBJECTS)
     
    189189        concurrency/coroutine.c concurrency/thread.c \
    190190        concurrency/kernel.c concurrency/monitor.c assert.c \
    191         exception.c typeobject.c \
    192         concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \
    193         concurrency/invoke.c concurrency/preemption.c
     191        exception.c virtual.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \
     192        concurrency/alarm.c concurrency/invoke.c \
     193        concurrency/preemption.c
    194194@BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \
    195195@BUILD_CONCURRENCY_TRUE@        concurrency/libcfa_a-thread.$(OBJEXT) \
     
    211211        libhdr/libcfa_a-libdebug.$(OBJEXT) $(am__objects_6) \
    212212        libcfa_a-assert.$(OBJEXT) libcfa_a-exception.$(OBJEXT) \
    213         libcfa_a-typeobject.$(OBJEXT) $(am__objects_7)
     213        libcfa_a-virtual.$(OBJEXT) $(am__objects_7)
    214214am_libcfa_a_OBJECTS = $(am__objects_8)
    215215libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
     
    423423libobjs = ${headers:=.o}
    424424libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \
    425         assert.c exception.c typeobject.c $(am__append_4)
     425        assert.c exception.c virtual.c $(am__append_4)
    426426libcfa_a_SOURCES = ${libsrc}
    427427libcfa_a_CFLAGS = -nodebug -O2
     
    598598@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-rational.Po@am__quote@
    599599@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-stdlib.Po@am__quote@
    600 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-typeobject.Po@am__quote@
     600@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-virtual.Po@am__quote@
    601601@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-assert.Po@am__quote@
    602602@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-exception.Po@am__quote@
     
    609609@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-rational.Po@am__quote@
    610610@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@
    611 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-typeobject.Po@am__quote@
     611@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-virtual.Po@am__quote@
    612612@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@
    613613@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-alarm.Po@am__quote@
     
    920920@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi`
    921921
    922 libcfa_d_a-typeobject.obj: typeobject.c
    923 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-typeobject.obj -MD -MP -MF $(DEPDIR)/libcfa_d_a-typeobject.Tpo -c -o libcfa_d_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
    924 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_d_a-typeobject.Tpo $(DEPDIR)/libcfa_d_a-typeobject.Po
    925 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='typeobject.c' object='libcfa_d_a-typeobject.obj' libtool=no @AMDEPBACKSLASH@
    926 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    927 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
     922libcfa_d_a-virtual.obj: virtual.c
     923@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-virtual.obj -MD -MP -MF $(DEPDIR)/libcfa_d_a-virtual.Tpo -c -o libcfa_d_a-virtual.obj `if test -f 'virtual.c'; then $(CYGPATH_W) 'virtual.c'; else $(CYGPATH_W) '$(srcdir)/virtual.c'; fi`
     924@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_d_a-virtual.Tpo $(DEPDIR)/libcfa_d_a-virtual.Po
     925@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='virtual.c' object='libcfa_d_a-virtual.obj' libtool=no @AMDEPBACKSLASH@
     926@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     927@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-virtual.obj `if test -f 'virtual.c'; then $(CYGPATH_W) 'virtual.c'; else $(CYGPATH_W) '$(srcdir)/virtual.c'; fi`
    928928
    929929concurrency/libcfa_d_a-alarm.o: concurrency/alarm.c
     
    12141214@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi`
    12151215
    1216 libcfa_a-typeobject.obj: typeobject.c
    1217 @am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libcfa_a-typeobject.obj -MD -MP -MF $(DEPDIR)/libcfa_a-typeobject.Tpo -c -o libcfa_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
    1218 @am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_a-typeobject.Tpo $(DEPDIR)/libcfa_a-typeobject.Po
    1219 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='typeobject.c' object='libcfa_a-typeobject.obj' libtool=no @AMDEPBACKSLASH@
    1220 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1221 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi`
     1216libcfa_a-virtual.obj: virtual.c
     1217@am__fastdepCC_TRUE@    $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libcfa_a-virtual.obj -MD -MP -MF $(DEPDIR)/libcfa_a-virtual.Tpo -c -o libcfa_a-virtual.obj `if test -f 'virtual.c'; then $(CYGPATH_W) 'virtual.c'; else $(CYGPATH_W) '$(srcdir)/virtual.c'; fi`
     1218@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_a-virtual.Tpo $(DEPDIR)/libcfa_a-virtual.Po
     1219@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='virtual.c' object='libcfa_a-virtual.obj' libtool=no @AMDEPBACKSLASH@
     1220@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1221@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-virtual.obj `if test -f 'virtual.c'; then $(CYGPATH_W) 'virtual.c'; else $(CYGPATH_W) '$(srcdir)/virtual.c'; fi`
    12221222
    12231223concurrency/libcfa_a-alarm.o: concurrency/alarm.c
     
    15131513        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    15141514
    1515 libcfa_a-typeobject.o : typeobject.c
     1515libcfa_a-virtual.o : virtual.c
    15161516        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $<
    15171517
     
    15221522        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    15231523
    1524 libcfa_d_a-typeobject.o : typeobject.c
     1524libcfa_d_a-virtual.o : virtual.c
    15251525        ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $<
    15261526
  • src/main.cc

    r4d4e5de rfcd17b2f  
    1111// Created On       : Fri May 15 23:12:02 2015
    1212// Last Modified By : Andrew Beach
    13 // Last Modified On : Fri Jul  7 11:13:00 2017
    14 // Update Count     : 442
     13// Last Modified On : Wed Jul 26 14:38:00 2017
     14// Update Count     : 443
    1515//
    1616
     
    5858#include "SynTree/Visitor.h"                // for acceptAll
    5959#include "Tuples/Tuples.h"                  // for expandMemberTuples, expan...
     60#include "Virtual/ExpandCasts.h"            // for expandCasts
    6061
    6162using namespace std;
     
    313314                }
    314315
     316                OPTPRINT( "virtual expandCasts" ) // Must come after translateEHM
     317                Virtual::expandCasts( translationUnit );
     318
    315319                OPTPRINT("instantiateGenerics")
    316320                GenPoly::instantiateGeneric( translationUnit );
  • src/prelude/builtins.c

    r4d4e5de rfcd17b2f  
    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 // builtins.c -- 
    8 // 
     6//
     7// builtins.c --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Fri Jul 21 16:21:03 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 10:34:20 2017
    13 // Update Count     : 13
    14 // 
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Jul 25 15:33:00 2017
     13// Update Count     : 14
     14//
    1515
    1616// exception implementation
     
    1818typedef unsigned long long __cfaabi_exception_type_t;
    1919
     20#include "../libcfa/virtual.h"
    2021#include "../libcfa/exception.h"
    2122
  • src/tests/designations.c

    r4d4e5de rfcd17b2f  
    99// Author           : Rob Schluntz
    1010// Created On       : Thu Jun 29 15:26:36 2017
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Jun 29 15:27:05 2017
    13 // Update Count     : 2
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 27 11:46:35 2017
     13// Update Count     : 3
    1414//
    1515
     
    8989};
    9090
     91struct Fred {
     92    double i[3];
     93    int j;
     94    struct Mary {
     95        struct Jane {
     96            double j;
     97        } j;
     98        double i;
     99    } m;
     100};
     101struct Fred s1 @= { .m.j : 3 };
     102struct Fred s2 @= { .i : { [2] : 2 } };
     103
    91104int main() {
    92105        // simple designation case - starting from beginning of structure, leaves ptr default-initialized (zero)
     
    199212        };
    200213#endif
    201 
     214        // array designation
     215        int i[2] = { [1] : 3 };
    202216        // allowed to have 'too many' initialized lists - essentially they are ignored.
    203217        int i1 = { 3 };
     
    240254        const char * str0 = "hello";
    241255        char str1[] = "hello";
     256        const char c1[] = "abc";
     257        const char c2[] = { 'a', 'b', 'c' };
     258        const char c3[][2] = { { 'a', 'b' }, { 'c', 'd'}, { 'c', 'd'} };
    242259}
    243260
Note: See TracChangeset for help on using the changeset viewer.