Changeset e3e16bc for src/SynTree


Ignore:
Timestamp:
Sep 13, 2017, 2:34:55 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

Renamed safe_dynamic_cast to strict_dynamic_cast

Location:
src/SynTree
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/AddressExpr.cc

    r9f5ecf5 re3e16bc  
    4747                } else {
    4848                        // taking address of non-lvalue -- must be a reference, loses one layer of reference
    49                         ReferenceType * refType = safe_dynamic_cast< ReferenceType * >( arg->get_result() );
     49                        ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->get_result() );
    5050                        set_result( addrType( refType->get_base() ) );
    5151                }
  • src/SynTree/ApplicationExpr.cc

    r9f5ecf5 re3e16bc  
    1414//
    1515
    16 #include <cassert>               // for safe_dynamic_cast, assert
     16#include <cassert>               // for strict_dynamic_cast, assert
    1717#include <list>                  // for list
    1818#include <map>                   // for _Rb_tree_const_iterator, map, map<>:...
     
    5050
    5151ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) {
    52         PointerType *pointer = safe_dynamic_cast< PointerType* >( funcExpr->get_result() );
    53         FunctionType *function = safe_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() );
    5454
    5555        set_result( ResolvExpr::extractResultType( function ) );
  • src/SynTree/CompoundStmt.cc

    r9f5ecf5 re3e16bc  
    1414//
    1515
    16 #include <cassert>                    // for assert, safe_dynamic_cast
     16#include <cassert>                    // for assert, strict_dynamic_cast
    1717#include <list>                       // for list, _List_const_iterator, lis...
    1818#include <ostream>                    // for operator<<, ostream, basic_ostream
     
    5252                Statement * origStmt = *origit++;
    5353                if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( s ) ) {
    54                         DeclStmt * origDeclStmt = safe_dynamic_cast< DeclStmt * >( origStmt );
     54                        DeclStmt * origDeclStmt = strict_dynamic_cast< DeclStmt * >( origStmt );
    5555                        if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * > ( declStmt->get_decl() ) ) {
    56                                 DeclarationWithType * origdwt = safe_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
     56                                DeclarationWithType * origdwt = strict_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
    5757                                assert( dwt->get_name() == origdwt->get_name() );
    5858                                declMap[ origdwt ] = dwt;
  • src/SynTree/Constant.cc

    r9f5ecf5 re3e16bc  
    1414//
    1515
    16 #include <cassert>   // for safe_dynamic_cast, assertf
     16#include <cassert>   // for strict_dynamic_cast, assertf
    1717#include <iostream>  // for operator<<, ostream, basic_ostream
    1818#include <string>    // for to_string, string, char_traits, operator<<
     
    5858
    5959unsigned long long Constant::get_ival() const {
    60         assertf( safe_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." );
    6161        return val.ival;
    6262}
    6363
    6464double Constant::get_dval() const {
    65         assertf( ! safe_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." );
    6666        return val.dval;
    6767}
  • src/SynTree/Declaration.h

    r9f5ecf5 re3e16bc  
    156156
    157157        Type * get_type() const { return type; }
    158         virtual void set_type(Type * t) { type = safe_dynamic_cast< FunctionType* >( t ); }
     158        virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); }
    159159
    160160        FunctionType * get_functionType() const { return type; }
  • src/SynTree/TupleExpr.cc

    r9f5ecf5 re3e16bc  
    1414//
    1515
    16 #include <cassert>              // for assert, safe_dynamic_cast, assertf
     16#include <cassert>              // for assert, strict_dynamic_cast, assertf
    1717#include <iterator>             // for next
    1818#include <list>                 // for list, _List_iterator
     
    6464
    6565TupleIndexExpr::TupleIndexExpr( Expression * tuple, unsigned int index ) : tuple( tuple ), index( index )  {
    66         TupleType * type = safe_dynamic_cast< TupleType * >( tuple->get_result() );
     66        TupleType * type = strict_dynamic_cast< TupleType * >( tuple->get_result() );
    6767        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() );
    6868        set_result( (*std::next( type->get_types().begin(), index ))->clone() );
Note: See TracChangeset for help on using the changeset viewer.