Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r2a4b088 rd3b7937  
    103103SizeofExpr::SizeofExpr( Expression *expr_, Expression *_aname ) :
    104104                Expression( _aname ), expr(expr_), type(0), isType(false) {
    105         add_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
     105        add_result( new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ) );
    106106}
    107107
    108108SizeofExpr::SizeofExpr( Type *type_, Expression *_aname ) :
    109109                Expression( _aname ), expr(0), type(type_), isType(true) {
    110         add_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
     110        add_result( new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ) );
    111111}
    112112
     
    134134AlignofExpr::AlignofExpr( Expression *expr_, Expression *_aname ) :
    135135                Expression( _aname ), expr(expr_), type(0), isType(false) {
    136         add_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
     136        add_result( new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ) );
    137137}
    138138
    139139AlignofExpr::AlignofExpr( Type *type_, Expression *_aname ) :
    140140                Expression( _aname ), expr(0), type(type_), isType(true) {
    141         add_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
     141        add_result( new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ) );
    142142}
    143143
     
    158158        else
    159159                expr->print(os, indent + 2);
    160 
    161         os << std::endl;
    162         Expression::print( os, indent );
    163 }
    164 
    165 UntypedOffsetofExpr::UntypedOffsetofExpr( Type *type_, const std::string &member_, Expression *_aname ) :
    166                 Expression( _aname ), type(type_), member(member_) {
    167         add_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    168 }
    169 
    170 UntypedOffsetofExpr::UntypedOffsetofExpr( const UntypedOffsetofExpr &other ) :
    171         Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {}
    172 
    173 UntypedOffsetofExpr::~UntypedOffsetofExpr() {
    174         delete type;
    175 }
    176 
    177 void UntypedOffsetofExpr::print( std::ostream &os, int indent) const {
    178         os << std::string( indent, ' ' ) << "Untyped Offsetof Expression on member " << member << " of ";
    179 
    180         if ( type ) {
    181                 type->print(os, indent + 2);
    182         } else {
    183                 os << "<NULL>";
    184         }
    185 
    186         os << std::endl;
    187         Expression::print( os, indent );
    188 }
    189 
    190 OffsetofExpr::OffsetofExpr( Type *type_, DeclarationWithType *member_, Expression *_aname ) :
    191                 Expression( _aname ), type(type_), member(member_) {
    192         add_result( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) );
    193 }
    194 
    195 OffsetofExpr::OffsetofExpr( const OffsetofExpr &other ) :
    196         Expression( other ), type( maybeClone( other.type ) ), member( maybeClone( other.member ) ) {}
    197 
    198 OffsetofExpr::~OffsetofExpr() {
    199         delete type;
    200         delete member;
    201 }
    202 
    203 void OffsetofExpr::print( std::ostream &os, int indent) const {
    204         os << std::string( indent, ' ' ) << "Offsetof Expression on member ";
    205 
    206         if ( member ) {
    207                 os << member->get_name();
    208         } else {
    209                 os << "<NULL>";
    210         }
    211 
    212         os << " of ";
    213 
    214         if ( type ) {
    215                 type->print(os, indent + 2);
    216         } else {
    217                 os << "<NULL>";
    218         }
    219160
    220161        os << std::endl;
Note: See TracChangeset for help on using the changeset viewer.