Changeset ac10576 for src/Parser


Ignore:
Timestamp:
Jul 18, 2017, 10:22:23 AM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
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:
a57cb58, d49bfa8
Parents:
b15f6cf
Message:

Replaced emptyQualifiers with noQualifiers for consistancy with noLabels and noAttributes.

Location:
src/Parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    rb15f6cf rac10576  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:17:07 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 15 16:09:04 2017
    13 // Update Count     : 549
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Jul 18 10:08:00 2017
     13// Update Count     : 550
    1414//
    1515
     
    4646// type.
    4747
    48 Type::Qualifiers emptyQualifiers;                               // no qualifiers on constants
     48Type::Qualifiers noQualifiers;                          // no qualifiers on constants
    4949
    5050static inline bool checkU( char c ) { return c == 'u' || c == 'U'; }
     
    118118        } // if
    119119
    120         Expression * ret = new ConstantExpr( Constant( new BasicType( emptyQualifiers, kind[Unsigned][size] ), str, v ) );
     120        Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) );
    121121        delete &str;                                                                            // created by lex
    122122        return ret;
     
    153153        } // if
    154154
    155         Expression * ret = new ConstantExpr( Constant( new BasicType( emptyQualifiers, kind[complx][size] ), str, v ) );
     155        Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) );
    156156        delete &str;                                                                            // created by lex
    157157        return ret;
     
    159159
    160160Expression *build_constantChar( const std::string & str ) {
    161         Expression * ret = new ConstantExpr( Constant( new BasicType( emptyQualifiers, BasicType::Char ), str, (unsigned long long int)(unsigned char)str[1] ) );
     161        Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, BasicType::Char ), str, (unsigned long long int)(unsigned char)str[1] ) );
    162162        delete &str;                                                                            // created by lex
    163163        return ret;
     
    166166ConstantExpr *build_constantStr( const std::string & str ) {
    167167        // string should probably be a primitive type
    168         ArrayType *at = new ArrayType( emptyQualifiers, new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ),
     168        ArrayType *at = new ArrayType( noQualifiers, new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ),
    169169                                                                   new ConstantExpr( Constant::from_ulong( str.size() + 1 - 2 ) ),  // +1 for '\0' and -2 for '"'
    170170                                                                   false, false );
     
    176176
    177177Expression *build_constantZeroOne( const std::string & str ) {
    178         Expression * ret = new ConstantExpr( Constant( str == "0" ? (Type *)new ZeroType( emptyQualifiers ) : (Type*)new OneType( emptyQualifiers ), str,
     178        Expression * ret = new ConstantExpr( Constant( str == "0" ? (Type *)new ZeroType( noQualifiers ) : (Type*)new OneType( noQualifiers ), str,
    179179                                                                                                   str == "0" ? (unsigned long long int)0 : (unsigned long long int)1 ) );
    180180        delete &str;                                                                            // created by lex
  • src/Parser/TypeData.cc

    rb15f6cf rac10576  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:58:00 2017
    13 // Update Count     : 565
     12// Last Modified On : Tus Jul 18 10:10:00 2017
     13// Update Count     : 566
    1414//
    1515
     
    454454          case TypeData::Builtin:
    455455                if(td->builtintype == DeclarationNode::Zero) {
    456                         return new ZeroType( emptyQualifiers );
     456                        return new ZeroType( noQualifiers );
    457457                }
    458458                else if(td->builtintype == DeclarationNode::One) {
    459                         return new OneType( emptyQualifiers );
     459                        return new OneType( noQualifiers );
    460460                }
    461461                else {
  • src/Parser/parserutility.cc

    rb15f6cf rac10576  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 15:30:39 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun 28 22:11:32 2017
    13 // Update Count     : 7
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Jul 18 10:12:00 2017
     13// Update Count     : 8
    1414//
    1515
     
    2626        UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) );
    2727        comparison->get_args().push_back( orig );
    28         comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( emptyQualifiers ), "0", (unsigned long long int)0 ) ) );
     28        comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( noQualifiers ), "0", (unsigned long long int)0 ) ) );
    2929        return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
    3030}
Note: See TracChangeset for help on using the changeset viewer.