Changeset 353d168 for src/SymTab/Validate.cc
- Timestamp:
- Aug 19, 2015, 3:59:45 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- 830c21a
- Parents:
- 18997b9 (diff), 4aa0858 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r18997b9 r353d168 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jul 22 13:16:00201513 // Update Count : 19 412 // Last Modified On : Wed Aug 05 14:00:24 2015 13 // Update Count : 195 14 14 // 15 15 … … 162 162 class EliminateTypedef : public Mutator { 163 163 public: 164 EliminateTypedef() : scopeLevel( 0 ) {} 164 EliminateTypedef() : scopeLevel( 0 ) {} 165 /// Replaces typedefs by forward declarations 165 166 static void eliminateTypedef( std::list< Declaration * > &translationUnit ); 166 167 private: … … 542 543 std::list<Statement *> initList; 543 544 initList.push_back( initStmt ); 544 545 545 546 UntypedExpr *cond = new UntypedExpr( new NameExpr( "?<?" ) ); 546 547 cond->get_args().push_back( new VariableExpr( index ) ); … … 617 618 618 619 // need to remove the prototypes, since this may be nested in a routine 619 for ( int start = 0, end = assigns.size() / 2; start < end; start++) {620 for (int start = 0, end = assigns.size()/2; start < end; start++) { 620 621 delete assigns.front(); 621 622 assigns.pop_front(); … … 892 893 TypedefMap oldNames = typedefNames; 893 894 DeclarationWithType *ret = Mutator::mutate( objDecl ); 895 typedefNames = oldNames; 894 896 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { 895 897 return new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn() ); … … 897 899 throw SemanticError( "invalid inline or _Noreturn specification in declaration of ", objDecl ); 898 900 } // if 899 typedefNames = oldNames;900 901 return ret; 901 902 } … … 960 961 } 961 962 962 Declaration *EliminateTypedef::mutate( ContextDecl * contextDecl ) {963 Declaration *EliminateTypedef::mutate( ContextDecl * contextDecl ) { 963 964 Mutator::mutate( contextDecl ); 964 965 return handleAggregate( contextDecl );
Note: See TracChangeset
for help on using the changeset viewer.