Changeset 10a7775 for src/InitTweak


Ignore:
Timestamp:
Jun 3, 2016, 2:02:29 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
e365cb5
Parents:
e01bfbc
Message:

can use intrinsic constructors on const objects

Location:
src/InitTweak
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    re01bfbc r10a7775  
    137137    }
    138138  }
     139
     140  Type * getPointerBase( Type * type ) {
     141    if ( PointerType * ptrType = dynamic_cast< PointerType * >( type ) ) {
     142      return ptrType->get_base();
     143    } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) {
     144      return arrayType->get_base();
     145    } else {
     146      return NULL;
     147    }
     148  }
     149
    139150}
  • src/InitTweak/InitTweak.h

    re01bfbc r10a7775  
    4848  /// returns the argument to a call expression in position N indexed from 0
    4949  Expression * getCallArg( Expression * callExpr, unsigned int pos );
     50
     51  /// returns the base type of a PointerType or ArrayType
     52  Type * getPointerBase( Type * );
    5053} // namespace
    5154
Note: See TracChangeset for help on using the changeset viewer.