Changeset 0720e049 for src/ResolvExpr
- Timestamp:
- Aug 11, 2017, 10:33:37 AM (7 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:
- 54cd58b
- Parents:
- 3d4b23fa (diff), 59a75cb (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:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Alternative.h
r3d4b23fa r0720e049 10 10 // Created On : Sat May 16 23:45:43 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 16 23:54:39 201513 // Update Count : 212 // Last Modified On : Sat Jul 22 09:36:36 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef ALTERNATIVE_H 17 #define ALTERNATIVE_H 16 #pragma once 18 17 19 18 #include <list> … … 47 46 } // namespace ResolvExpr 48 47 49 #endif // ALTERNATIVE_H50 51 48 // Local Variables: // 52 49 // tab-width: 4 // -
src/ResolvExpr/AlternativeFinder.cc
r3d4b23fa r0720e049 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sat May 16 23:52:08 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 09:14:17201713 // Update Count : 3 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jul 26 11:33:00 2017 13 // Update Count : 31 14 14 // 15 15 … … 878 878 } 879 879 880 void AlternativeFinder::visit( VirtualCastExpr * castExpr ) { 881 assertf( castExpr->get_result(), "Implicate virtual cast targets not yet supported." ); 882 AlternativeFinder finder( indexer, env ); 883 // don't prune here, since it's guaranteed all alternatives will have the same type 884 // (giving the alternatives different types is half of the point of ConstructorExpr nodes) 885 finder.findWithAdjustment( castExpr->get_arg(), false ); 886 for ( Alternative & alt : finder.alternatives ) { 887 alternatives.push_back( Alternative( 888 new VirtualCastExpr( alt.expr->clone(), castExpr->get_result()->clone() ), 889 alt.env, alt.cost ) ); 890 } 891 } 892 880 893 void AlternativeFinder::visit( UntypedMemberExpr *memberExpr ) { 881 894 AlternativeFinder funcFinder( indexer, env ); -
src/ResolvExpr/AlternativeFinder.h
r3d4b23fa r0720e049 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sat May 16 23:56:12 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Tue Apr 19 11:44:53 201613 // Update Count : 211 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jul 26 11:24:00 2017 13 // Update Count : 4 14 14 // 15 15 16 #ifndef ALTERNATIVEFINDER_H 17 #define ALTERNATIVEFINDER_H 16 #pragma once 18 17 19 18 #include <set> … … 50 49 virtual void visit( AddressExpr *addressExpr ); 51 50 virtual void visit( CastExpr *castExpr ); 51 virtual void visit( VirtualCastExpr *castExpr ); 52 52 virtual void visit( UntypedMemberExpr *memberExpr ); 53 53 virtual void visit( MemberExpr *memberExpr ); … … 132 132 } // namespace ResolvExpr 133 133 134 #endif // ALTERNATIVEFINDER_H135 136 134 // Local Variables: // 137 135 // tab-width: 4 // -
src/ResolvExpr/AlternativePrinter.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 06:55:43 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un May 17 06:57:12 201513 // Update Count : 312 // Last Modified On : Sat Jul 22 09:37:09 2017 13 // Update Count : 4 14 14 // 15 15 16 #ifndef ALTERNATIVEPRINTER_H 17 #define ALTERNATIVEPRINTER_H 16 #pragma once 18 17 19 18 #include <iostream> … … 34 33 } // namespace ResolvExpr 35 34 36 #endif // ALTERNATIVEPRINTER_H37 38 35 // Local Variables: // 39 36 // tab-width: 4 // -
src/ResolvExpr/ConversionCost.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 09:37:28 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:35:56 201613 // Update Count : 312 // Last Modified On : Sat Jul 22 09:38:24 2017 13 // Update Count : 4 14 14 // 15 15 16 #ifndef CONVERSIONCOST_H 17 #define CONVERSIONCOST_H 16 #pragma once 18 17 19 18 #include "SynTree/Visitor.h" … … 51 50 } // namespace ResolvExpr 52 51 53 #endif // CONVERSIONCOST_H */54 55 52 // Local Variables: // 56 53 // tab-width: 4 // -
src/ResolvExpr/Cost.h
r3d4b23fa r0720e049 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 09:39:50 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Wed Jul 22 16:43:10 201513 // Update Count : 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:35:55 2017 13 // Update Count : 5 14 14 // 15 15 16 #ifndef COST_H 17 #define COST_H 16 #pragma once 18 17 19 18 #include <iostream> … … 114 113 } // namespace ResolvExpr 115 114 116 #endif // COST_H117 118 115 // Local Variables: // 119 116 // tab-width: 4 // -
src/ResolvExpr/CurrentObject.cc
r3d4b23fa r0720e049 38 38 return constExpr->get_constant()->get_ival(); 39 39 } else { 40 assertf( false, "Non-integer constant expression in getConstValue ", toString( constExpr ).c_str() ); // xxx - might be semantic error40 assertf( false, "Non-integer constant expression in getConstValue %s", toString( constExpr ).c_str() ); // xxx - might be semantic error 41 41 } 42 42 } else if ( dynamic_cast< OneType * >( constExpr->get_result() ) ) { … … 163 163 setPosition( castExpr->get_arg() ); 164 164 } else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) { 165 assertf( dynamic_cast<EnumInstType *> ( varExpr->get_result() ), "ArrayIterator given variable that isn't an enum constant ", toString( expr ).c_str() );165 assertf( dynamic_cast<EnumInstType *> ( varExpr->get_result() ), "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() ); 166 166 index = 0; // xxx - get actual value of enum constant 167 167 } else if ( dynamic_cast< SizeofExpr * >( expr ) || dynamic_cast< AlignofExpr * >( expr ) ) { … … 505 505 curTypes = newTypes; 506 506 newTypes.clear(); 507 assertf( desigAlts.size() == curTypes.size(), "Designator alternatives (% d) and current types (%d) out of sync", desigAlts.size(), curTypes.size() );507 assertf( desigAlts.size() == curTypes.size(), "Designator alternatives (%zu) and current types (%zu) out of sync", desigAlts.size(), curTypes.size() ); 508 508 } // for 509 509 if ( desigAlts.size() > 1 ) { -
src/ResolvExpr/CurrentObject.h
r3d4b23fa r0720e049 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Jun 8 11:07:25 2017 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Jun 8 11:07:41201713 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:36:48 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef CURRENT_OBJECT_H 17 #define CURRENT_OBJECT_H 16 #pragma once 18 17 19 18 #include <stack> … … 51 50 } // namespace ResolvExpr 52 51 53 #endif // CURRENT_OBJECT_H54 55 52 // Local Variables: // 56 53 // tab-width: 4 // -
src/ResolvExpr/FindOpenVars.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 09:46:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un May 17 09:47:20 201513 // Update Count : 212 // Last Modified On : Sat Jul 22 09:35:18 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef FINDOPENVARS_H 17 #define FINDOPENVARS_H 16 #pragma once 18 17 19 18 #include "Unify.h" … … 25 24 } // namespace ResolvExpr 26 25 27 #endif // FINDOPENVARS_H28 29 26 // Local Variables: // 30 27 // tab-width: 4 // -
src/ResolvExpr/RenameVars.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 12:10:28 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:36:39 201613 // Update Count : 312 // Last Modified On : Sat Jul 22 09:33:54 2017 13 // Update Count : 4 14 14 // 15 15 16 #ifndef RESOLVEXPR_RENAMEVARS_H 17 #define RESOLVEXPR_RENAMEVARS_H 16 #pragma once 18 17 19 18 #include <list> … … 56 55 } // namespace ResolvExpr 57 56 58 #endif // RENAMEVARS_H59 60 57 // Local Variables: // 61 58 // tab-width: 4 // -
src/ResolvExpr/ResolveTypeof.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 12:14:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un May 17 12:16:29 201513 // Update Count : 212 // Last Modified On : Sat Jul 22 09:38:35 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef RESOLVETYPEOF_H 17 #define RESOLVETYPEOF_H 16 #pragma once 18 17 19 18 #include "SynTree/SynTree.h" … … 24 23 } // namespace ResolvExpr 25 24 26 #endif // RESOLVETYPEOF_H27 28 25 // Local Variables: // 29 26 // tab-width: 4 // -
src/ResolvExpr/Resolver.cc
r3d4b23fa r0720e049 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : T hu Mar 23 17:23:14201713 // Update Count : 21 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Aug 8 16:06:00 2017 13 // Update Count : 212 14 14 // 15 15 … … 71 71 virtual void visit( ReturnStmt *returnStmt ) override; 72 72 virtual void visit( ThrowStmt *throwStmt ) override; 73 virtual void visit( CatchStmt *catchStmt ) override; 73 74 74 75 virtual void visit( SingleInit *singleInit ) override; … … 368 369 369 370 void Resolver::visit( ThrowStmt *throwStmt ) { 371 // TODO: Replace *exception type with &exception type. 370 372 if ( throwStmt->get_expr() ) { 371 Expression * wrapped = new CastExpr( throwStmt->get_expr(), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 373 StructDecl * exception_decl = 374 lookupStruct( "__cfaehm__base_exception_t" ); 375 assert( exception_decl ); 376 Expression * wrapped = new CastExpr( 377 throwStmt->get_expr(), 378 new PointerType( 379 noQualifiers, 380 new StructInstType( 381 noQualifiers, 382 exception_decl 383 ) 384 ) 385 ); 372 386 Expression * newExpr = findSingleExpression( wrapped, *this ); 373 387 throwStmt->set_expr( newExpr ); 388 } 389 } 390 391 void Resolver::visit( CatchStmt *catchStmt ) { 392 if ( catchStmt->get_cond() ) { 393 Expression * wrapped = new CastExpr( 394 catchStmt->get_cond(), 395 new BasicType( noQualifiers, BasicType::Bool ) 396 ); 397 catchStmt->set_cond( findSingleExpression( wrapped, *this ) ); 374 398 } 375 399 } -
src/ResolvExpr/Resolver.h
r3d4b23fa r0720e049 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:18:34 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Apr 14 15:06:53 201613 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:36:57 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef RESOLVER_H 17 #define RESOLVER_H 16 #pragma once 18 17 19 18 #include "SynTree/SynTree.h" … … 29 28 } // namespace ResolvExpr 30 29 31 #endif // RESOLVER_H32 33 30 // Local Variables: // 34 31 // tab-width: 4 // -
src/ResolvExpr/TypeEnvironment.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 12:24:58 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un May 17 12:26:52 201513 // Update Count : 212 // Last Modified On : Sat Jul 22 09:35:45 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef TYPEENVIRONMENT_H 17 #define TYPEENVIRONMENT_H 16 #pragma once 18 17 19 18 #include <string> … … 99 98 } // namespace ResolvExpr 100 99 101 #endif // TYPEENVIRONMENT_H */102 103 100 // Local Variables: // 104 101 // tab-width: 4 // -
src/ResolvExpr/TypeMap.h
r3d4b23fa r0720e049 9 9 // Author : Aaron B. Moss 10 10 // Created On : Fri Feb 19 13:55:00 2016 11 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Fri Feb 19 13:55:00 2016 13 // Update Count : 1 14 // 15 16 #ifndef _TYPEMAP_H 17 #define _TYPEMAP_H 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:37:19 2017 13 // Update Count : 2 14 // 15 16 #pragma once 18 17 19 18 #include <map> … … 204 203 } // namespace ResolvExpr 205 204 206 #endif // _TYPEMAP_H207 208 205 // Local Variables: // 209 206 // tab-width: 4 // -
src/ResolvExpr/Unify.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 13:09:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 13:10:34 201513 // Update Count : 212 // Last Modified On : Fri Jul 21 23:09:34 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef UNIFY_H 17 #define UNIFY_H 16 #pragma once 18 17 19 18 #include <map> … … 72 71 } // namespace ResolvExpr 73 72 74 #endif // UNIFY_H75 76 73 // Local Variables: // 77 74 // tab-width: 4 // -
src/ResolvExpr/typeops.h
r3d4b23fa r0720e049 10 10 // Created On : Sun May 17 07:28:22 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un May 17 07:33:11 201513 // Update Count : 212 // Last Modified On : Sat Jul 22 09:36:18 2017 13 // Update Count : 3 14 14 // 15 15 16 #ifndef TYPEOPS_H 17 #define TYPEOPS_H 16 #pragma once 18 17 19 18 #include "SynTree/SynTree.h" … … 157 156 } // namespace ResolvExpr 158 157 159 #endif // TYPEOPS_H160 161 158 // Local Variables: // 162 159 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.