Changeset 4c2e561 for src


Ignore:
Timestamp:
Jul 4, 2023, 4:29:10 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
3430ce8
Parents:
3397eed (diff), 7f1be01 (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/Common/ScopedMap.h

    r3397eed r4c2e561  
    199199        friend class ScopedMap;
    200200        friend class const_iterator;
    201         typedef typename ScopedMap::MapType::iterator wrapped_iterator;
    202         typedef typename ScopedMap::ScopeList scope_list;
    203         typedef typename scope_list::size_type size_type;
     201        typedef typename MapType::iterator wrapped_iterator;
     202        typedef typename ScopeList::size_type size_type;
    204203
    205204        /// Checks if this iterator points to a valid item
     
    220219        }
    221220
    222         iterator(scope_list & _scopes, const wrapped_iterator & _it, size_type inLevel)
     221        iterator(ScopeList & _scopes, const wrapped_iterator & _it, size_type inLevel)
    223222                : scopes(&_scopes), it(_it), level(inLevel) {}
    224223public:
     
    266265
    267266private:
    268         scope_list *scopes;
     267        ScopeList *scopes;
    269268        wrapped_iterator it;
    270269        size_type level;
  • src/Concurrency/KeywordsNew.cpp

    r3397eed r4c2e561  
    534534void ConcurrentSueKeyword::addGetRoutines(
    535535                const ast::ObjectDecl * field, const ast::FunctionDecl * forward ) {
     536        // Clone the signature and then build the body.
     537        ast::FunctionDecl * decl = ast::deepCopy( forward );
     538
    536539        // Say it is generated at the "same" places as the forward declaration.
    537         const CodeLocation & location = forward->location;
    538 
    539         const ast::DeclWithType * param = forward->params.front();
     540        const CodeLocation & location = decl->location;
     541
     542        const ast::DeclWithType * param = decl->params.front();
    540543        ast::Stmt * stmt = new ast::ReturnStmt( location,
    541544                new ast::AddressExpr( location,
     
    551554        );
    552555
    553         ast::FunctionDecl * decl = ast::deepCopy( forward );
    554556        decl->stmts = new ast::CompoundStmt( location, { stmt } );
    555557        declsToAddAfter.push_back( decl );
  • src/GenPoly/ErasableScopedMap.h

    r3397eed r4c2e561  
    5757        /// Starts a new scope
    5858        void beginScope() {
    59                 Scope scope;
    60                 scopes.push_back(scope);
     59                scopes.emplace_back();
    6160        }
    6261
     
    145144                public std::iterator< std::bidirectional_iterator_tag, value_type > {
    146145        friend class ErasableScopedMap;
    147         typedef typename std::map< Key, Value >::iterator wrapped_iterator;
    148         typedef typename std::vector< std::map< Key, Value > > scope_list;
    149         typedef typename scope_list::size_type size_type;
     146        typedef typename Scope::iterator wrapped_iterator;
     147        typedef typename ScopeList::size_type size_type;
    150148
    151149        /// Checks if this iterator points to a valid item
  • src/GenPoly/ScopedSet.h

    r3397eed r4c2e561  
    4747        /// Starts a new scope
    4848        void beginScope() {
    49                 Scope scope;
    50                 scopes.push_back(scope);
     49                scopes.emplace_back();
    5150        }
    5251
     
    8584        iterator findNext( const_iterator &it, const Value &key ) {
    8685                if ( it.i == 0 ) return end();
    87                         for ( size_type i = it.i - 1; ; --i ) {
     86                for ( size_type i = it.i - 1; ; --i ) {
    8887                        typename Scope::iterator val = scopes[i].find( key );
    8988                        if ( val != scopes[i].end() ) return iterator( scopes, val, i );
     
    112111        friend class ScopedSet;
    113112        friend class const_iterator;
    114         typedef typename std::set< Value >::iterator wrapped_iterator;
    115         typedef typename std::vector< std::set< Value > > scope_list;
    116         typedef typename scope_list::size_type size_type;
     113        typedef typename Scope::iterator wrapped_iterator;
     114        typedef typename ScopeList::size_type size_type;
    117115
    118116        /// Checks if this iterator points to a valid item
     
    133131        }
    134132
    135         iterator(scope_list const &_scopes, const wrapped_iterator &_it, size_type _i)
     133        iterator(ScopeList const &_scopes, const wrapped_iterator &_it, size_type _i)
    136134                : scopes(&_scopes), it(_it), i(_i) {}
    137135public:
     
    176174
    177175private:
    178         scope_list const *scopes;
     176        ScopeList const *scopes;
    179177        wrapped_iterator it;
    180178        size_type i;
     
    185183                public std::iterator< std::bidirectional_iterator_tag, value_type > {
    186184        friend class ScopedSet;
    187         typedef typename std::set< Value >::iterator wrapped_iterator;
    188         typedef typename std::set< Value >::const_iterator wrapped_const_iterator;
    189         typedef typename std::vector< std::set< Value > > scope_list;
    190         typedef typename scope_list::size_type size_type;
     185        typedef typename Scope::iterator wrapped_iterator;
     186        typedef typename Scope::const_iterator wrapped_const_iterator;
     187        typedef typename ScopeList::size_type size_type;
    191188
    192189        /// Checks if this iterator points to a valid item
     
    207204        }
    208205
    209         const_iterator(scope_list const &_scopes, const wrapped_const_iterator &_it, size_type _i)
     206        const_iterator(ScopeList const &_scopes, const wrapped_const_iterator &_it, size_type _i)
    210207                : scopes(&_scopes), it(_it), i(_i) {}
    211208public:
     
    255252
    256253private:
    257         scope_list const *scopes;
     254        ScopeList const *scopes;
    258255        wrapped_const_iterator it;
    259256        size_type i;
  • src/SymTab/FixFunction.cc

    r3397eed r4c2e561  
    109109
    110110                const ast::DeclWithType * postvisit( const ast::FunctionDecl * func ) {
    111                         return new ast::ObjectDecl{
    112                                 func->location, func->name, new ast::PointerType{ func->type }, nullptr,
     111                        // Cannot handle cases with asserions.
     112                        assert( func->assertions.empty() );
     113                        return new ast::ObjectDecl{
     114                                func->location, func->name, new ast::PointerType( func->type ), nullptr,
    113115                                func->storage, func->linkage, nullptr, copy( func->attributes ) };
    114116                }
     
    117119
    118120                const ast::Type * postvisit( const ast::ArrayType * array ) {
    119                         return new ast::PointerType{ 
    120                                 array->base, array->dimension, array->isVarLen, array->isStatic, 
     121                        return new ast::PointerType{
     122                                array->base, array->dimension, array->isVarLen, array->isStatic,
    121123                                array->qualifiers };
    122124                }
Note: See TracChangeset for help on using the changeset viewer.