Changeset 1ced874 for src/ResolvExpr
- Timestamp:
- Sep 6, 2016, 4:36:29 PM (9 years ago)
- 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:
- e76acbe
- Parents:
- 0362d42 (diff), f04a8b81 (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. - Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/ResolvExpr/AlternativeFinder.cc ¶
r0362d42 r1ced874 42 42 #include "Common/utility.h" 43 43 #include "InitTweak/InitTweak.h" 44 #include "ResolveTypeof.h" 44 45 45 46 extern bool resolvep; … … 740 741 void AlternativeFinder::visit( CastExpr *castExpr ) { 741 742 for ( std::list< Type* >::iterator i = castExpr->get_results().begin(); i != castExpr->get_results().end(); ++i ) { 743 *i = resolveTypeof( *i, indexer ); 742 744 SymTab::validateType( *i, &indexer ); 743 745 adjustExprType( *i, env, indexer ); … … 828 830 829 831 void AlternativeFinder::visit( VariableExpr *variableExpr ) { 830 alternatives.push_back( Alternative( variableExpr->clone(), env, Cost::zero ) ); 832 // not sufficient to clone here, because variable's type may have changed 833 // since the VariableExpr was originally created. 834 alternatives.push_back( Alternative( new VariableExpr( variableExpr->get_var() ), env, Cost::zero ) ); 831 835 } 832 836 … … 837 841 void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) { 838 842 if ( sizeofExpr->get_isType() ) { 843 // xxx - resolveTypeof? 839 844 alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) ); 840 845 } else { … … 856 861 void AlternativeFinder::visit( AlignofExpr *alignofExpr ) { 857 862 if ( alignofExpr->get_isType() ) { 863 // xxx - resolveTypeof? 858 864 alternatives.push_back( Alternative( alignofExpr->clone(), env, Cost::zero ) ); 859 865 } else { … … 889 895 void AlternativeFinder::visit( UntypedOffsetofExpr *offsetofExpr ) { 890 896 AlternativeFinder funcFinder( indexer, env ); 897 // xxx - resolveTypeof? 891 898 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( offsetofExpr->get_type() ) ) { 892 899 addOffsetof( structInst, offsetofExpr->get_member() ); -
TabularUnified src/ResolvExpr/Resolver.cc ¶
r0362d42 r1ced874 528 528 529 529 void Resolver::visit( ConstructorInit *ctorInit ) { 530 try { 531 maybeAccept( ctorInit->get_ctor(), *this ); 532 maybeAccept( ctorInit->get_dtor(), *this ); 533 } catch ( SemanticError ) { 534 // no alternatives for the constructor initializer - fallback on C-style initializer 535 // xxx - not sure if this makes a ton of sense - should maybe never be able to have this situation? 536 fallbackInit( ctorInit ); 537 return; 538 } 530 // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit 531 maybeAccept( ctorInit->get_ctor(), *this ); 532 maybeAccept( ctorInit->get_dtor(), *this ); 539 533 540 534 // found a constructor - can get rid of C-style initializer
Note: See TracChangeset
for help on using the changeset viewer.