Ignore:
Timestamp:
Aug 20, 2016, 7:06:26 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, 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:
ab57786, d30790f
Parents:
e6955b1 (diff), 4a7d895 (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.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    re6955b1 r80722d0  
    5757static inline bool checkX( char c ) { return c == 'x' || c == 'X'; }
    5858
    59 Expression *build_constantInteger( std::string & str ) {
     59Expression *build_constantInteger( const std::string & str ) {
    6060        static const BasicType::Kind kind[2][3] = {
    6161                { BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt },
     
    123123} // build_constantInteger
    124124
    125 Expression *build_constantFloat( std::string & str ) {
     125Expression *build_constantFloat( const std::string & str ) {
    126126        static const BasicType::Kind kind[2][3] = {
    127127                { BasicType::Float, BasicType::Double, BasicType::LongDouble },
     
    153153} // build_constantFloat
    154154
    155 Expression *build_constantChar( std::string & str ) {
     155Expression *build_constantChar( const std::string & str ) {
    156156        return new ConstantExpr( Constant( new BasicType( emptyQualifiers, BasicType::Char ), str ) );
    157157} // build_constantChar
    158158
    159 ConstantExpr *build_constantStr( std::string & str ) {
     159ConstantExpr *build_constantStr( const std::string & str ) {
    160160        // string should probably be a primitive type
    161161        ArrayType *at = new ArrayType( emptyQualifiers, new BasicType( emptyQualifiers, BasicType::Char ),
     
    213213}
    214214Expression *build_sizeOftype( DeclarationNode *decl_node ) {
    215         return new SizeofExpr( decl_node->buildType() );
     215        Expression* ret = new SizeofExpr( decl_node->buildType() );
     216        delete decl_node;
     217        return ret;
    216218}
    217219Expression *build_alignOfexpr( ExpressionNode *expr_node ) {
     
    222224}
    223225Expression *build_offsetOf( DeclarationNode *decl_node, NameExpr *member ) {
    224         return new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() );
     226        Expression* ret = new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() );
     227        delete decl_node;
     228        delete member;
     229        return ret;
    225230}
    226231
Note: See TracChangeset for help on using the changeset viewer.