Changeset 615a096


Ignore:
Timestamp:
Mar 17, 2017, 9:58:23 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
409433da, 946bcca
Parents:
395fc37
Message:

fix BFCommon problem on gcc-4.9, and begin consistent renaming

Location:
src
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 09:09:09 2017
    13 // Update Count     : 480
     12// Last Modified On : Fri Mar 17 09:06:01 2017
     13// Update Count     : 481
    1414//
    1515
     
    539539                if ( castExpr->get_result()->isVoid() ) {
    540540                        output << "(void)" ;
    541                 } else if ( ! castExpr->get_result()->get_isLvalue() ) {
     541                } else if ( ! castExpr->get_result()->get_lvalue() ) {
    542542                        // at least one result type of cast, but not an lvalue
    543543                        output << "(";
  • src/CodeGen/GenType.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 13:53:43 2017
    13 // Update Count     : 20
     12// Last Modified On : Fri Mar 17 09:02:28 2017
     13// Update Count     : 22
    1414//
    1515
     
    9999                        os << "static ";
    100100                } // if
    101                 if ( qualifiers.isConst ) {
     101                if ( qualifiers.is_const ) {
    102102                        os << "const ";
    103103                } // if
    104                 if ( qualifiers.isVolatile ) {
     104                if ( qualifiers.is_volatile ) {
    105105                        os << "volatile ";
    106106                } // if
    107                 if ( qualifiers.isRestrict ) {
     107                if ( qualifiers.is_restrict ) {
    108108                        os << "__restrict ";
    109109                } // if
    110                 if ( qualifiers.isAtomic ) {
     110                if ( qualifiers.is_atomic ) {
    111111                        os << "_Atomic ";
    112112                } // if
     
    238238
    239239        void GenType::handleQualifiers( Type *type ) {
    240                 if ( type->get_isConst() ) {
     240                if ( type->get_const() ) {
    241241                        typeString = "const " + typeString;
    242242                } // if
    243                 if ( type->get_isVolatile() ) {
     243                if ( type->get_volatile() ) {
    244244                        typeString = "volatile " + typeString;
    245245                } // if
    246                 if ( type->get_isRestrict() ) {
     246                if ( type->get_restrict() ) {
    247247                        typeString = "__restrict " + typeString;
    248248                } // if
    249                 if ( type->get_isAtomic() ) {
     249                if ( type->get_atomic() ) {
    250250                        typeString = "_Atomic " + typeString;
    251251                } // if
  • src/Concurrency/Keywords.cc

    r395fc37 r615a096  
    1212// Last Modified By :
    1313// Last Modified On :
    14 // Update Count     : 1
     14// Update Count     : 3
    1515//
    1616
     
    154154                        //Find mutex arguments
    155155                        Type* ty = arg->get_type();
    156                         if( ! ty->get_qualifiers().isMutex ) continue;
     156                        if( ! ty->get_mutex() ) continue;
    157157
    158158                        //Append it to the list
     
    175175
    176176                //Make sure that typed isn't mutex
    177                 if( ! base->get_qualifiers().isMutex ) throw SemanticError( "mutex keyword may only appear once per argument ", arg );
     177                if( ! base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg );
    178178        }
    179179
  • src/GenPoly/Box.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:35:33 2017
    13 // Update Count     : 338
     12// Last Modified On : Fri Mar 17 09:06:37 2017
     13// Update Count     : 339
    1414//
    1515
     
    753753                                        // if the argument's type is polymorphic, we don't need to box again!
    754754                                        return;
    755                                 } else if ( arg->get_result()->get_isLvalue() ) {
     755                                } else if ( arg->get_result()->get_lvalue() ) {
    756756                                        // VariableExpr and MemberExpr are lvalues; need to check this isn't coming from the second arg of a comma expression though (not an lvalue)
    757757                                        // xxx - need to test that this code is still reachable
  • src/GenPoly/Lvalue.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 15 15:33:13 2015
    13 // Update Count     : 3
     12// Last Modified On : Fri Mar 17 09:11:18 2017
     13// Update Count     : 5
    1414//
    1515
     
    7979                        if ( function->get_returnVals().empty() ) return 0;
    8080                        Type *ty = function->get_returnVals().front()->get_type();
    81                         return ty->get_isLvalue() ? ty : 0;
     81                        return ty->get_lvalue() ? ty : 0;
    8282                }
    8383
     
    134134                Statement * Pass1::mutate(ReturnStmt *retStmt) {
    135135                        if ( retval && retStmt->get_expr() ) {
    136                                 if ( retStmt->get_expr()->get_result()->get_isLvalue() ) {
     136                                if ( retStmt->get_expr()->get_result()->get_lvalue() ) {
    137137                                        // ***** Code Removal ***** because casts may be stripped already
    138138
  • src/InitTweak/FixInit.cc

    r395fc37 r615a096  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:08:04 2017
    13 // Update Count     : 67
     12// Last Modified On : Fri Mar 17 09:13:47 2017
     13// Update Count     : 71
    1414//
    1515
     
    438438                        env->apply( result );
    439439                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    440                         tmp->get_type()->set_isConst( false );
     440                        tmp->get_type()->set_const( false );
    441441
    442442                        // create and resolve copy constructor
     
    484484                                env->apply( result );
    485485                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    486                                 ret->get_type()->set_isConst( false );
     486                                ret->get_type()->set_const( false );
    487487                                impCpCtorExpr->get_returnDecls().push_back( ret );
    488488                                CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; )
    489                                 if ( ! result->get_isLvalue() ) {
     489                                if ( ! result->get_lvalue() ) {
    490490                                        // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
    491491                                        destructRet( ret, impCpCtorExpr );
     
    507507                                env->apply( result );
    508508                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    509                                 ret->get_type()->set_isConst( false );
     509                                ret->get_type()->set_const( false );
    510510                                stmtExpr->get_returnDecls().push_front( ret );
    511511
     
    588588
    589589                                Expression * retExpr = new CommaExpr( assign, new VariableExpr( returnDecl ) );
    590                                 if ( callExpr->get_result()->get_isLvalue() ) {
     590                                if ( callExpr->get_result()->get_lvalue() ) {
    591591                                        // lvalue returning functions are funny. Lvalue.cc inserts a *? in front of any lvalue returning
    592592                                        // non-intrinsic function. Add an AddressExpr to the call to negate the derefence and change the
  • src/InitTweak/GenInit.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:01:25 2017
    13 // Update Count     : 181
     12// Last Modified On : Fri Mar 17 09:12:36 2017
     13// Update Count     : 183
    1414//
    1515
     
    143143                // is being returned
    144144                // Note: under the assumption that assignments return *this, checking for ?=? here is an optimization, since it shouldn't be necessary to copy construct `this`. This is a temporary optimization until reference types are added, at which point this should be removed, along with the analogous optimization in copy constructor generation.
    145                 if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_isLvalue() ) {
     145                if ( returnStmt->get_expr() && returnVals.size() == 1 && funcName != "?=?" && ! returnVals.front()->get_type()->get_lvalue() ) {
    146146                        // explicitly construct the return value using the return expression and the retVal object
    147147                        assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() );
     
    195195
    196196                        ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
    197                         arrayDimension->get_type()->set_isConst( true );
     197                        arrayDimension->get_type()->set_const( true );
    198198
    199199                        arrayType->set_dimension( new VariableExpr( arrayDimension ) );
  • src/Parser/DeclarationNode.cc

    r395fc37 r615a096  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 17:16:31 2017
    13 // Update Count     : 1014
     12// Last Modified On : Fri Mar 17 08:46:05 2017
     13// Update Count     : 1017
    1414//
    1515
     
    432432                for ( unsigned int i = 0; i < Type::NumTypeQualifier; i += 1 ) { // find duplicates
    433433                        if ( qsrc[i] && qdst[i] ) {
    434                                 appendError( error, string( "duplicate " ) + Type::Qualifiers::Names[i] );
     434                                appendError( error, string( "duplicate " ) + Type::QualifiersNames[i] );
    435435                        } // if
    436436                } // for
     
    442442                for ( unsigned int i = 0; i < Type::NumFuncSpecifier; i += 1 ) { // find duplicates
    443443                        if ( funcSpecs[i] && src->funcSpecs[i] ) {
    444                                 appendError( error, string( "duplicate " ) + Type::FuncSpecifiers::Names[i] );
     444                                appendError( error, string( "duplicate " ) + Type::FuncSpecifiersNames[i] );
    445445                        } // if
    446446                } // for
     
    451451                        for ( unsigned int i = 0; i < Type::NumStorageClass; i += 1 ) { // find duplicates
    452452                                if ( storageClasses[i] && src->storageClasses[i] ) {
    453                                         appendError( error, string( "duplicate " ) + Type::StorageClasses::Names[i] );
     453                                        appendError( error, string( "duplicate " ) + Type::StorageClassesNames[i] );
    454454                                } // if
    455455                        } // for
    456456                        // src is the new item being added and has a single bit
    457457                } else if ( ! src->storageClasses.is_threadlocal ) { // conflict ?
    458                         appendError( error, string( "conflicting " ) + Type::StorageClasses::Names[storageClasses.ffs()] +
    459                                                  " & " + Type::StorageClasses::Names[src->storageClasses.ffs()] );
     458                        appendError( error, string( "conflicting " ) + Type::StorageClassesNames[storageClasses.ffs()] +
     459                                                 " & " + Type::StorageClassesNames[src->storageClasses.ffs()] );
    460460                        src->storageClasses.reset();                            // FIX to preserve invariant of one basic storage specifier
    461461                } // if
  • src/Parser/TypeData.cc

    r395fc37 r615a096  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:32:42 2017
    13 // Update Count     : 559
     12// Last Modified On : Fri Mar 17 08:46:10 2017
     13// Update Count     : 560
    1414//
    1515
     
    227227void TypeData::print( ostream &os, int indent ) const {
    228228        for ( int i = 0; i < Type::NumTypeQualifier; i += 1 ) {
    229                 if ( qualifiers[i] ) os << Type::Qualifiers::Names[ i ] << ' ';
     229                if ( qualifiers[i] ) os << Type::QualifiersNames[ i ] << ' ';
    230230        } // for
    231231
  • src/Parser/lex.ll

    r395fc37 r615a096  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Thu Mar  9 21:38:26 2017
    13  * Update Count     : 505
     12 * Last Modified On : Mon Mar 13 08:36:17 2017
     13 * Update Count     : 506
    1414 */
    1515
     
    313313
    314314                                /* punctuation */
     315"@"                             { ASCIIOP_RETURN(); }
    315316"["                             { ASCIIOP_RETURN(); }
    316317"]"                             { ASCIIOP_RETURN(); }
  • src/ResolvExpr/AlternativeFinder.cc

    r395fc37 r615a096  
    1010// Created On       : Sat May 16 23:52:08 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul  4 17:02:51 2016
    13 // Update Count     : 29
     12// Last Modified On : Fri Mar 17 09:14:17 2017
     13// Update Count     : 30
    1414//
    1515
     
    771771        bool isLvalue( Expression *expr ) {
    772772                // xxx - recurse into tuples?
    773                 return expr->has_result() && expr->get_result()->get_isLvalue();
     773                return expr->has_result() && expr->get_result()->get_lvalue();
    774774        }
    775775
  • src/SymTab/Autogen.cc

    r395fc37 r615a096  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:37:22 2017
    13 // Update Count     : 59
     12// Last Modified On : Fri Mar 17 09:41:08 2017
     13// Update Count     : 60
    1414//
    1515
     
    323323                                }
    324324
    325                                 if ( type->get_qualifiers().isConst && func->get_name() == "?=?" ) {
     325                                if ( type->get_const() && func->get_name() == "?=?" ) {
    326326                                        // don't assign const members, but do construct/destruct
    327327                                        continue;
  • src/SymTab/Autogen.h

    r395fc37 r615a096  
    1010// Created On       : Sun May 17 21:53:34 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 07:51:39 2017
    13 // Update Count     : 8
     12// Last Modified On : Fri Mar 17 09:10:41 2017
     13// Update Count     : 9
    1414//
    1515
     
    6060//                      castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false);
    6161                        castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
    62                         castType->set_isLvalue( true ); // xxx - might not need this
     62                        castType->set_lvalue( true ); // xxx - might not need this
    6363                        dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) );
    6464                }
  • src/SymTab/Mangler.cc

    r395fc37 r615a096  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:40:29 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:52:24 2015
    13 // Update Count     : 19
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Mar 17 09:40:01 2017
     13// Update Count     : 20
    1414//
    1515
     
    294294                        mangleName << "_";
    295295                } // if
    296                 if ( type->get_isConst() ) {
     296                if ( type->get_const() ) {
    297297                        mangleName << "C";
    298298                } // if
    299                 if ( type->get_isVolatile() ) {
     299                if ( type->get_volatile() ) {
    300300                        mangleName << "V";
    301301                } // if
     
    304304//                      mangleName << "R";
    305305//              } // if
    306                 if ( type->get_isLvalue() ) {
     306                if ( type->get_lvalue() ) {
    307307                        mangleName << "L";
    308308                } // if
    309                 if ( type->get_isAtomic() ) {
     309                if ( type->get_atomic() ) {
    310310                        mangleName << "A";
    311311                } // if
  • src/SynTree/ArrayType.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  1 17:16:29 2017
    13 // Update Count     : 12
     12// Last Modified On : Fri Mar 17 09:40:30 2017
     13// Update Count     : 13
    1414//
    1515
     
    2121ArrayType::ArrayType( const Type::Qualifiers &tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes )
    2222        : Type( tq, attributes ), base( base ), dimension( dimension ), isVarLen( isVarLen ), isStatic( isStatic ) {
    23         base->set_isLvalue( false );
     23        base->set_lvalue( false );
    2424}
    2525
  • src/SynTree/Expression.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug  5 14:23:56 2016
    13 // Update Count     : 49
     12// Last Modified On : Fri Mar 17 09:42:04 2017
     13// Update Count     : 51
    1414//
    1515
     
    7777        assert( var->get_type() );
    7878        Type * type = var->get_type()->clone();
    79         type->set_isLvalue( true );
     79        type->set_lvalue( true );
    8080        set_result( type );
    8181}
     
    352352        sub.apply( res );
    353353        set_result( res );
    354         get_result()->set_isLvalue( true );
     354        get_result()->set_lvalue( true );
    355355}
    356356
  • src/SynTree/TupleExpr.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:59:19 2015
    13 // Update Count     : 1
     12// Last Modified On : Fri Mar 17 09:42:29 2017
     13// Update Count     : 3
    1414//
    1515
     
    6060        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() );
    6161        set_result( (*std::next( type->get_types().begin(), index ))->clone() );
    62         get_result()->set_isLvalue( type->get_isLvalue() );
     62        get_result()->set_lvalue( type->get_lvalue() );
    6363}
    6464
  • src/SynTree/Type.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 16:25:49 2017
    13 // Update Count     : 27
     12// Last Modified On : Fri Mar 17 08:42:47 2017
     13// Update Count     : 28
    1414//
    1515
     
    6161
    6262// These must remain in the same order as the corresponding bit fields.
    63 const char * Type::FuncSpecifiers::Names[] = { "inline", "fortran", "_Noreturn" };
    64 const char * Type::StorageClasses::Names[] = { "extern", "static", "auto", "register", "_Thread_local" };
    65 const char * Type::Qualifiers::Names[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" };
     63const char * Type::FuncSpecifiersNames[] = { "inline", "fortran", "_Noreturn" };
     64const char * Type::StorageClassesNames[] = { "extern", "static", "auto", "register", "_Thread_local" };
     65const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" };
    6666
    6767Type *Type::stripDeclarator() {
  • src/SynTree/Type.h

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 17:44:11 2017
    13 // Update Count     : 135
     12// Last Modified On : Fri Mar 17 09:04:03 2017
     13// Update Count     : 147
    1414//
    1515
     
    2626  public:
    2727        // Simulate inheritance because union does not allow it.
     28        // Bug in g++-4.9 prevents static field in union
     29        //static const char * Names[];
    2830        #define BFCommon( BFType, N ) \
    2931                bool operator[]( unsigned int i ) const { return val & (1 << i); } \
     
    3133                void reset() { val = 0; } \
    3234                int ffs() { return ::ffs( val ) - 1; } \
    33                 static const char * Names[]; \
    3435                BFType operator&=( BFType other ) { \
    3536                        val &= other.val; return *this; \
     
    5556                                for ( unsigned int i = 0; i < N; i += 1 ) { \
    5657                                        if ( (*this)[i] ) { \
    57                                                 os << Names[i] << ' '; \
     58                                                os << BFType##Names[i] << ' '; \
    5859                                        } \
    5960                                } \
     
    6465
    6566        enum { Inline = 1 << 0, Noreturn = 1 << 1, Fortran = 1 << 2, NumFuncSpecifier = 3 };
     67        static const char * FuncSpecifiersNames[];
    6668        union FuncSpecifiers {
    6769                unsigned int val;
     
    7375                FuncSpecifiers() : val( 0 ) {}
    7476                FuncSpecifiers( unsigned int val ) : val( val ) {}
    75                 bool operator==( FuncSpecifiers other ) const { return val == other.val; }
    76                 bool operator!=( FuncSpecifiers other ) const { return val != other.val; }
     77                // equality (==, !=) works implicitly on first field "val", relational operations are undefined.
    7778                BFCommon( FuncSpecifiers, NumFuncSpecifier )
    7879        }; // FuncSpecifiers
    7980
    8081        enum { Extern = 1 << 0, Static = 1 << 1, Auto = 1 << 2, Register = 1 << 3, Threadlocal = 1 << 4, NumStorageClass = 5 };
     82        static const char * StorageClassesNames[];
    8183        union StorageClasses {
    8284                unsigned int val;
     
    9193                StorageClasses() : val( 0 ) {}
    9294                StorageClasses( unsigned int val ) : val( val ) {}
    93                 bool operator==( StorageClasses other ) const { return val == other.val; }
    94                 bool operator!=( StorageClasses other ) const { return val != other.val; }
     95                // equality (==, !=) works implicitly on first field "val", relational operations are undefined.
    9596                BFCommon( StorageClasses, NumStorageClass )
    9697        }; // StorageClasses
    9798
    9899        enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NumTypeQualifier = 6 };
     100        static const char * QualifiersNames[];
    99101        union Qualifiers {
    100102                enum { Mask = ~(Restrict | Lvalue) };
    101103                unsigned int val;
    102104                struct {
    103                         bool isConst : 1;
    104                         bool isRestrict : 1;
    105                         bool isVolatile : 1;
    106                         bool isLvalue : 1;
    107                         bool isMutex : 1;
    108                         bool isAtomic : 1;
     105                        bool is_const : 1;
     106                        bool is_restrict : 1;
     107                        bool is_volatile : 1;
     108                        bool is_lvalue : 1;
     109                        bool is_mutex : 1;
     110                        bool is_atomic : 1;
    109111                };
    110112
    111113                Qualifiers() : val( 0 ) {}
    112114                Qualifiers( unsigned int val ) : val( val ) {}
    113                 bool operator==( Qualifiers other ) const {
    114                         return (val & Mask) == (other.val & Mask);
    115                 }
    116                 bool operator!=( Qualifiers other ) const {
    117                         return (val & Mask) != (other.val & Mask);
    118                 }
     115                // Complex comparisons provide implicit qualifier downcasting, e.g., T downcast to const T.
     116                bool operator==( Qualifiers other ) const { return (val & Mask) == (other.val & Mask); }
     117                bool operator!=( Qualifiers other ) const { return (val & Mask) != (other.val & Mask); }
    119118                bool operator<=( Qualifiers other ) const {
    120                         return isConst <= other.isConst && isVolatile <= other.isVolatile &&
    121                                 isMutex >= other.isMutex && isAtomic == other.isAtomic;
     119                        return is_const <= other.is_const && is_volatile <= other.is_volatile &&
     120                                is_mutex >= other.is_mutex && is_atomic == other.is_atomic;
    122121                }
    123122                bool operator<( Qualifiers other ) const { return *this != other && *this <= other; }
     
    132131
    133132        Qualifiers & get_qualifiers() { return tq; }
    134         bool get_isConst() { return tq.isConst; }
    135         bool get_isVolatile() { return tq.isVolatile; }
    136         bool get_isRestrict() { return tq.isRestrict; }
    137         bool get_isLvalue() { return tq.isLvalue; }
    138         bool get_isAtomic() { return tq.isAtomic; }
    139         void set_isConst( bool newValue ) { tq.isConst = newValue; }
    140         void set_isVolatile( bool newValue ) { tq.isVolatile = newValue; }
    141         void set_isRestrict( bool newValue ) { tq.isRestrict = newValue; }
    142         void set_isLvalue( bool newValue ) { tq.isLvalue = newValue; }
    143         void set_isAtomic( bool newValue ) { tq.isAtomic = newValue; }
     133        bool get_const() { return tq.is_const; }
     134        bool get_volatile() { return tq.is_volatile; }
     135        bool get_restrict() { return tq.is_restrict; }
     136        bool get_lvalue() { return tq.is_lvalue; }
     137        bool get_mutex() { return tq.is_mutex; }
     138        bool get_atomic() { return tq.is_atomic; }
     139        void set_const( bool newValue ) { tq.is_const = newValue; }
     140        void set_volatile( bool newValue ) { tq.is_volatile = newValue; }
     141        void set_restrict( bool newValue ) { tq.is_restrict = newValue; }
     142        void set_lvalue( bool newValue ) { tq.is_lvalue = newValue; }
     143        void set_mutex( bool newValue ) { tq.is_mutex = newValue; }
     144        void set_atomic( bool newValue ) { tq.is_atomic = newValue; }
    144145
    145146        typedef std::list<TypeDecl *> ForallList;
  • src/Tuples/TupleAssignment.cc

    r395fc37 r615a096  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:04:51 2017
    13 // Update Count     : 7
     12// Last Modified On : Fri Mar 17 09:43:03 2017
     13// Update Count     : 8
    1414//
    1515
     
    200200                                assert( type );
    201201                                type->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
    202                                 type->set_isLvalue( true ); // xxx - might not need this
     202                                type->set_lvalue( true ); // xxx - might not need this
    203203                                expr = new CastExpr( expr, castType );
    204204                        }
Note: See TracChangeset for help on using the changeset viewer.