Changeset b13fc10


Ignore:
Timestamp:
May 3, 2017, 3:15:09 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
9643b31
Parents:
1ed841f (diff), dba6db9 (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

Location:
src
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • src/CodeTools/module.mk

    r1ed841f rb13fc10  
    1515###############################################################################
    1616
    17 SRC += CodeTools/DeclStats.cc
     17SRC += CodeTools/DeclStats.cc \
     18        CodeTools/TrackLoc.cc
  • src/GenPoly/InstantiateGeneric.cc

    r1ed841f rb13fc10  
    233233                                } else {
    234234                                        // normalize possibly dtype-static parameter type
    235                                         out.push_back( new TypeExpr{ 
     235                                        out.push_back( new TypeExpr{
    236236                                                ScrubTyVars::scrubAll( paramType->get_type()->clone() ) } );
    237237                                        gt |= genericType::concrete;
     
    369369                                DeclMutator::addDeclaration( concDecl );
    370370                                insert( inst, typeSubs, concDecl );
     371                                concDecl->acceptMutator( *this ); // recursively instantiate members
    371372                        }
    372373                        StructInstType *newInst = new StructInstType( inst->get_qualifiers(), concDecl->get_name() );
     
    423424                                DeclMutator::addDeclaration( concDecl );
    424425                                insert( inst, typeSubs, concDecl );
     426                                concDecl->acceptMutator( *this ); // recursively instantiate members
    425427                        }
    426428                        UnionInstType *newInst = new UnionInstType( inst->get_qualifiers(), concDecl->get_name() );
  • src/Makefile.in

    r1ed841f rb13fc10  
    108108        CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) \
    109109        CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT) \
     110        CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT) \
    110111        Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT) \
    111112        Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \
     
    388389        CodeGen/FixNames.cc CodeGen/FixMain.cc \
    389390        CodeGen/OperatorTable.cc CodeTools/DeclStats.cc \
    390         Concurrency/Keywords.cc Common/SemanticError.cc \
    391         Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \
     391        CodeTools/TrackLoc.cc Concurrency/Keywords.cc \
     392        Common/SemanticError.cc Common/UniqueName.cc \
     393        Common/DebugMalloc.cc Common/Assert.cc \
    392394        ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \
    393395        ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
     
    545547        @: > CodeTools/$(DEPDIR)/$(am__dirstamp)
    546548CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT):  \
     549        CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp)
     550CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT):  \
    547551        CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp)
    548552Concurrency/$(am__dirstamp):
     
    843847        -rm -f CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT)
    844848        -rm -f CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT)
     849        -rm -f CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT)
    845850        -rm -f Common/driver_cfa_cpp-Assert.$(OBJEXT)
    846851        -rm -f Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT)
     
    954959@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@
    955960@AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po@am__quote@
     961@AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po@am__quote@
    956962@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@
    957963@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po@am__quote@
     
    11951201@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`
    11961202
     1203CodeTools/driver_cfa_cpp-TrackLoc.o: CodeTools/TrackLoc.cc
     1204@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-TrackLoc.o -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo -c -o CodeTools/driver_cfa_cpp-TrackLoc.o `test -f 'CodeTools/TrackLoc.cc' || echo '$(srcdir)/'`CodeTools/TrackLoc.cc
     1205@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po
     1206@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='CodeTools/TrackLoc.cc' object='CodeTools/driver_cfa_cpp-TrackLoc.o' libtool=no @AMDEPBACKSLASH@
     1207@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1208@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-TrackLoc.o `test -f 'CodeTools/TrackLoc.cc' || echo '$(srcdir)/'`CodeTools/TrackLoc.cc
     1209
     1210CodeTools/driver_cfa_cpp-TrackLoc.obj: CodeTools/TrackLoc.cc
     1211@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-TrackLoc.obj -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo -c -o CodeTools/driver_cfa_cpp-TrackLoc.obj `if test -f 'CodeTools/TrackLoc.cc'; then $(CYGPATH_W) 'CodeTools/TrackLoc.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/TrackLoc.cc'; fi`
     1212@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po
     1213@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='CodeTools/TrackLoc.cc' object='CodeTools/driver_cfa_cpp-TrackLoc.obj' libtool=no @AMDEPBACKSLASH@
     1214@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1215@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-TrackLoc.obj `if test -f 'CodeTools/TrackLoc.cc'; then $(CYGPATH_W) 'CodeTools/TrackLoc.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/TrackLoc.cc'; fi`
     1216
    11971217Concurrency/driver_cfa_cpp-Keywords.o: Concurrency/Keywords.cc
    11981218@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc
  • src/Parser/parser.yy

    r1ed841f rb13fc10  
    393393        | '(' compound_statement ')'                                            // GCC, lambda expression
    394394                { $$ = new ExpressionNode( build_valexpr( $2 ) ); }
     395        | primary_expression '{' argument_expression_list '}' // CFA
     396                {
     397                        Token fn;
     398                        fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
     399                        $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     400                }
    395401        ;
    396402
     
    425431        | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal
    426432                { $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); }
    427         | postfix_expression '{' argument_expression_list '}' // CFA
     433        | '^' primary_expression '{' argument_expression_list '}' // CFA
    428434                {
    429435                        Token fn;
    430                         fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    431                         $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     436                        fn.str = new string( "^?{}" );                          // location undefined
     437                        $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) );
    432438                }
    433439        ;
     
    730736        | exception_statement
    731737        | asm_statement
    732         | '^' postfix_expression '{' argument_expression_list '}' ';' // CFA
    733                 {
    734                         Token fn;
    735                         fn.str = new string( "^?{}" );                          // location undefined
    736                         $$ = new StatementNode( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) ) ) );
    737                 }
    738         ;
    739738
    740739labeled_statement:
  • src/SymTab/Validate.cc

    r1ed841f rb13fc10  
    240240                ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
    241241                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
     242                acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist
     243                VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
    242244                Concurrency::applyKeywords( translationUnit );
    243245                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
    244246                Concurrency::implementMutexFuncs( translationUnit );
    245247                Concurrency::implementThreadStarter( translationUnit );
    246                 acceptAll( translationUnit, epc );
    247248                ReturnChecker::checkFunctionReturns( translationUnit );
    248249                compoundliteral.mutateDeclarationList( translationUnit );
    249250                acceptAll( translationUnit, pass3 );
    250                 VerifyCtorDtorAssign::verify( translationUnit );
    251251                ArrayLength::computeLength( translationUnit );
    252252        }
     
    817817                                throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl );
    818818                        }
    819                         if ( ! dynamic_cast< PointerType * >( params.front()->get_type() ) ) {
     819                        PointerType * ptrType = dynamic_cast< PointerType * >( params.front()->get_type() );
     820                        if ( ! ptrType || ptrType->is_array() ) {
    820821                                throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer ", funcDecl );
    821822                        }
  • src/SynTree/PointerType.cc

    r1ed841f rb13fc10  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // PointerType.cc -- 
     7// PointerType.cc --
    88//
    99// Author           : Richard C. Bilson
     
    3838void PointerType::print( std::ostream &os, int indent ) const {
    3939        Type::print( os, indent );
    40         os << "pointer to ";
    41         if ( isStatic ) {
    42                 os << "static ";
    43         } // if
    44         if ( isVarLen ) {
    45                 os << "variable length array of ";
    46         } else if ( dimension ) {
    47                 os << "array of ";
    48                 dimension->print( os, indent );
    49         } // if
     40        if ( ! is_array() ) {
     41                os << "pointer to ";
     42        } else {
     43                os << "decayed ";
     44                if ( isStatic ) {
     45                        os << "static ";
     46                } // if
     47                if ( isVarLen ) {
     48                        os << "variable length array of ";
     49                } else if ( dimension ) {
     50                        os << "array of ";
     51                        dimension->print( os, indent );
     52                        os << " ";
     53                } // if
     54        }
    5055        if ( base ) {
    5156                base->print( os, indent );
  • src/SynTree/Type.h

    r1ed841f rb13fc10  
    247247        void set_isStatic( bool newValue ) { isStatic = newValue; }
    248248
     249        bool is_array() const { return isStatic || isVarLen || dimension; }
     250
    249251        virtual PointerType *clone() const { return new PointerType( *this ); }
    250252        virtual void accept( Visitor & v ) { v.visit( this ); }
  • src/SynTree/Visitor.h

    r1ed841f rb13fc10  
    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 : Thu Feb  9 14:23:24 2017
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed May  3 08:58:00 2017
    1313// Update Count     : 10
    1414//
     
    2626        virtual ~Visitor();
    2727  public:
     28        // visit: Default implementation of all functions visits the children
     29    // of the given syntax node, but performs no other action.
     30
    2831        virtual void visit( ObjectDecl *objectDecl );
    2932        virtual void visit( FunctionDecl *functionDecl );
Note: See TracChangeset for help on using the changeset viewer.