Ignore:
Timestamp:
Oct 28, 2016, 1:11:12 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
4b1afb6
Parents:
837f999 (diff), 0ebac75 (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 plg2:software/cfa/cfa-cc

Conflicts:

src/Makefile.am
src/Makefile.in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/TypeMap.h

    r837f999 rf849c8e  
    3838                typedef typename std::map< std::string, Value* > ValueMap;
    3939                typedef typename ValueMap::iterator ValueMapIterator;
    40                
     40
    4141                Value *voidValue;                                     ///< Value for void type
    4242                Value *basicValue[BasicType::NUMBER_OF_BASIC_TYPES];  ///< Values for basic types
     
    5454                        /// One scope of map rollbacks
    5555                        typedef std::vector< std::pair< ValueMapIterator, Value* > > MapScope;
    56                        
     56
    5757                        PointerScope pointers;  ///< Value pointers to roll back to their previous state
    5858                        MapScope mapNodes;      ///< Value map iterators to roll back to their previous state
     
    6868
    6969                std::vector< Rollback > scopes;  ///< Scope rollback information
    70                
     70
    7171                struct Lookup : public Visitor {
    7272                        Lookup( TypeMap<Value> &typeMap ) : typeMap( typeMap ), found( 0 ), toInsert( 0 ) {}
     
    8787                                return found;
    8888                        }
    89                        
     89
    9090                        void findAndReplace( Value *&loc ) {
    9191                                found = loc;
     
    109109                                }
    110110                        }
    111                        
     111
    112112                        virtual void visit( VoidType *voidType ) {
    113113                                findAndReplace( typeMap.voidValue );
    114114                        }
    115                        
     115
    116116                        virtual void visit( BasicType *basicType ) {
    117117                                findAndReplace( typeMap.basicValue[basicType->get_kind()] );
    118118                        }
    119                        
     119
    120120                        virtual void visit( PointerType *pointerType ) {
    121121                                // NOTE This is one of the places where the apporoximation of the resolver is (deliberately) poor;
     
    129129                                }
    130130                        }
    131                        
     131
    132132                        virtual void visit( ArrayType *arrayType ) {
    133133                                if ( dynamic_cast< FunctionType* >( arrayType->get_base() ) ) {
     
    137137                                }
    138138                        }
    139                        
     139
    140140                        virtual void visit( FunctionType *functionType ) {
    141141                                findAndReplace( typeMap.functionPointerValue );
    142142                        }
    143                        
     143
    144144                        virtual void visit( StructInstType *structType ) {
    145145                                findAndReplace( typeMap.structValue, structType->get_name() );
    146146                        }
    147                        
     147
    148148                        virtual void visit( UnionInstType *unionType ) {
    149149                                findAndReplace( typeMap.unionValue, unionType->get_name() );
    150150                        }
    151                        
     151
    152152                        virtual void visit( EnumInstType *enumType ) {
    153153                                findAndReplace( typeMap.enumValue, enumType->get_name() );
     
    157157                        Value *found;             ///< Value found (NULL if none yet)
    158158                        Value *toInsert;          ///< Value to insert (NULL if a lookup)
    159                 };  // class Lookup
    160                 friend class Lookup;
    161                
     159                };  // struct Lookup
     160                friend struct Lookup;
     161
    162162        public:
    163163                /// Starts a new scope
     
    180180                        scopes.pop_back();
    181181                }
    182                
     182
    183183                TypeMap() : voidValue( 0 ), pointerValue( 0 ), voidPointerValue( 0 ), functionPointerValue( 0 ), structValue(), unionValue(), enumValue(), scopes() {
    184184                        beginScope();
     
    199199                        return searcher.find( key );
    200200                }
    201                
     201
    202202        }; // class TypeMap
    203203
Note: See TracChangeset for help on using the changeset viewer.