Changeset 10e81ac


Ignore:
Timestamp:
May 27, 2016, 4:16:53 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
725f36f
Parents:
aad5a48 (diff), 677c1be (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:
5 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    raad5a48 r10e81ac  
    131131                                // optimization: don't need to copy construct in order to call intrinsic functions
    132132                                return appExpr;
    133                         } else if ( FunctionDecl * funcDecl = dynamic_cast< FunctionDecl * > ( function->get_var() ) ) {
    134                                 FunctionType * ftype = funcDecl->get_functionType();
     133                        } else if ( DeclarationWithType * funcDecl = dynamic_cast< DeclarationWithType * > ( function->get_var() ) ) {
     134                                // FunctionType * ftype = funcDecl->get_functionType();
     135                                FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->get_type() ) );
     136                                assert( ftype );
    135137                                if ( (funcDecl->get_name() == "?{}" || funcDecl->get_name() == "?=?") && ftype->get_parameters().size() == 2 ) {
    136138                                        Type * t1 = ftype->get_parameters().front()->get_type();
     
    138140                                        PointerType * ptrType = dynamic_cast< PointerType * > ( t1 );
    139141                                        assert( ptrType );
     142
    140143                                        if ( ResolvExpr::typesCompatible( ptrType->get_base(), t2, SymTab::Indexer() ) ) {
    141144                                                // optimization: don't need to copy construct in order to call a copy constructor or
  • src/SymTab/Autogen.cc

    raad5a48 r10e81ac  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed May 11 13:22:03 2016
     12// Last Modified On : Thu May 26 14:14:09 2016
    1313// Update Count     : 1
    1414//
     
    163163        /// Creates a new type decl that's the same as src, but renamed and with only the ?=?, ?{} (default and copy), and ^?{} assertions (for complete types only)
    164164        TypeDecl *cloneAndRename( TypeDecl *src, const std::string &name ) {
     165                // TypeDecl *dst = new TypeDecl( name, src->get_storageClass(), 0, src->get_kind() );
     166
     167                // if ( src->get_kind() == TypeDecl::Any ) {
     168                //      TypeInstType *opParamType = new TypeInstType( Type::Qualifiers(), name, dst );
     169                //      FunctionType *opFunctionType = new FunctionType( Type::Qualifiers(), false );
     170                //      opFunctionType->get_parameters().push_back(
     171                //              new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), opParamType->clone() ), 0 ) );
     172                //      FunctionDecl *ctorAssert = new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType->clone(), 0, false, false );
     173                //      FunctionDecl *dtorAssert = new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType->clone(), 0, false, false );
     174
     175                //      opFunctionType->get_parameters().push_back(
     176                //              new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, opParamType, 0 ) );
     177                //      FunctionDecl *copyCtorAssert = new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType->clone(), 0, false, false );
     178
     179                //      opFunctionType->get_returnVals().push_back(
     180                //              new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, opParamType->clone(), 0 ) );
     181                //      FunctionDecl *assignAssert = new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType, 0, false, false );
     182
     183
     184                //      dst->get_assertions().push_back( assignAssert );
     185                //      dst->get_assertions().push_back( ctorAssert );
     186                //      dst->get_assertions().push_back( dtorAssert );
     187                //      dst->get_assertions().push_back( copyCtorAssert );
     188                // }
     189
    165190                TypeDecl *dst = new TypeDecl( src->get_name(), src->get_storageClass(), 0, src->get_kind() );
    166191                cloneAll(src->get_assertions(), dst->get_assertions());
  • src/SymTab/Validate.cc

    raad5a48 r10e81ac  
    385385
    386386        void Pass2::visit( StructDecl *structDecl ) {
     387                // visit struct members first so that the types of self-referencing members are updated properly
     388                Parent::visit( structDecl );
    387389                if ( ! structDecl->get_members().empty() ) {
    388390                        ForwardStructsType::iterator fwds = forwardStructs.find( structDecl->get_name() );
     
    394396                        } // if
    395397                } // if
    396                 Indexer::visit( structDecl );
    397398        }
    398399
    399400        void Pass2::visit( UnionDecl *unionDecl ) {
     401                Parent::visit( unionDecl );
    400402                if ( ! unionDecl->get_members().empty() ) {
    401403                        ForwardUnionsType::iterator fwds = forwardUnions.find( unionDecl->get_name() );
     
    407409                        } // if
    408410                } // if
    409                 Indexer::visit( unionDecl );
    410411        }
    411412
  • src/SynTree/ApplicationExpr.cc

    raad5a48 r10e81ac  
    6464
    6565void ApplicationExpr::print( std::ostream &os, int indent ) const {
    66         os << "Application of" << std::endl << std::string(indent, ' ');
     66        os << "Application of" << std::endl << std::string(indent+2, ' ');
    6767        function->print( os, indent+2 );
    6868        if ( ! args.empty() ) {
  • src/main.cc

    raad5a48 r10e81ac  
    203203                } else {
    204204                        input = stdin;
     205                        // if running cfa-cpp directly, might forget to pass -F option. Since this takes from stdin, pass
     206                        // a fake name along
     207                        if ( filename == NULL ) filename = "stdin";
    205208                } // if
    206209
Note: See TracChangeset for help on using the changeset viewer.