Changeset e3e16bc for src/SynTree
- Timestamp:
- Sep 13, 2017, 2:34:55 PM (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:
- 982832e
- Parents:
- 9f5ecf5
- Location:
- src/SynTree
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/AddressExpr.cc
r9f5ecf5 re3e16bc 47 47 } else { 48 48 // taking address of non-lvalue -- must be a reference, loses one layer of reference 49 ReferenceType * refType = s afe_dynamic_cast< ReferenceType * >( arg->get_result() );49 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->get_result() ); 50 50 set_result( addrType( refType->get_base() ) ); 51 51 } -
src/SynTree/ApplicationExpr.cc
r9f5ecf5 re3e16bc 14 14 // 15 15 16 #include <cassert> // for s afe_dynamic_cast, assert16 #include <cassert> // for strict_dynamic_cast, assert 17 17 #include <list> // for list 18 18 #include <map> // for _Rb_tree_const_iterator, map, map<>:... … … 50 50 51 51 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) { 52 PointerType *pointer = s afe_dynamic_cast< PointerType* >( funcExpr->get_result() );53 FunctionType *function = s afe_dynamic_cast< FunctionType* >( pointer->get_base() );52 PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() ); 53 FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->get_base() ); 54 54 55 55 set_result( ResolvExpr::extractResultType( function ) ); -
src/SynTree/CompoundStmt.cc
r9f5ecf5 re3e16bc 14 14 // 15 15 16 #include <cassert> // for assert, s afe_dynamic_cast16 #include <cassert> // for assert, strict_dynamic_cast 17 17 #include <list> // for list, _List_const_iterator, lis... 18 18 #include <ostream> // for operator<<, ostream, basic_ostream … … 52 52 Statement * origStmt = *origit++; 53 53 if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( s ) ) { 54 DeclStmt * origDeclStmt = s afe_dynamic_cast< DeclStmt * >( origStmt );54 DeclStmt * origDeclStmt = strict_dynamic_cast< DeclStmt * >( origStmt ); 55 55 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * > ( declStmt->get_decl() ) ) { 56 DeclarationWithType * origdwt = s afe_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );56 DeclarationWithType * origdwt = strict_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ); 57 57 assert( dwt->get_name() == origdwt->get_name() ); 58 58 declMap[ origdwt ] = dwt; -
src/SynTree/Constant.cc
r9f5ecf5 re3e16bc 14 14 // 15 15 16 #include <cassert> // for s afe_dynamic_cast, assertf16 #include <cassert> // for strict_dynamic_cast, assertf 17 17 #include <iostream> // for operator<<, ostream, basic_ostream 18 18 #include <string> // for to_string, string, char_traits, operator<< … … 58 58 59 59 unsigned long long Constant::get_ival() const { 60 assertf( s afe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." );60 assertf( strict_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." ); 61 61 return val.ival; 62 62 } 63 63 64 64 double Constant::get_dval() const { 65 assertf( ! s afe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve dval from integer constant." );65 assertf( ! strict_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve dval from integer constant." ); 66 66 return val.dval; 67 67 } -
src/SynTree/Declaration.h
r9f5ecf5 re3e16bc 156 156 157 157 Type * get_type() const { return type; } 158 virtual void set_type(Type * t) { type = s afe_dynamic_cast< FunctionType* >( t ); }158 virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); } 159 159 160 160 FunctionType * get_functionType() const { return type; } -
src/SynTree/TupleExpr.cc
r9f5ecf5 re3e16bc 14 14 // 15 15 16 #include <cassert> // for assert, s afe_dynamic_cast, assertf16 #include <cassert> // for assert, strict_dynamic_cast, assertf 17 17 #include <iterator> // for next 18 18 #include <list> // for list, _List_iterator … … 64 64 65 65 TupleIndexExpr::TupleIndexExpr( Expression * tuple, unsigned int index ) : tuple( tuple ), index( index ) { 66 TupleType * type = s afe_dynamic_cast< TupleType * >( tuple->get_result() );66 TupleType * type = strict_dynamic_cast< TupleType * >( tuple->get_result() ); 67 67 assertf( type->size() > index, "TupleIndexExpr index out of bounds: tuple size %d, requested index %d in expr %s", type->size(), index, toString( tuple ).c_str() ); 68 68 set_result( (*std::next( type->get_types().begin(), index ))->clone() );
Note: See TracChangeset
for help on using the changeset viewer.