Changeset b03eed6 for src/Parser
- Timestamp:
- Apr 19, 2018, 5:54:41 PM (8 years ago)
- 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, with_gc
- Children:
- 8633f060
- Parents:
- e16294d (diff), da9d79b (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. - Location:
- src/Parser
- Files:
-
- 5 edited
-
DeclarationNode.cc (modified) (1 diff)
-
ExpressionNode.cc (modified) (3 diffs)
-
ParseNode.h (modified) (1 diff)
-
TypeData.cc (modified) (1 diff)
-
parser.yy (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
re16294d rb03eed6 924 924 delete newType->aggInst.aggregate->enumeration.constants; 925 925 newType->aggInst.aggregate->enumeration.constants = nullptr; 926 newType->aggInst.aggregate->enumeration.body = false; 926 927 } else { 927 928 assert( newType->aggInst.aggregate->kind == TypeData::Aggregate ); 928 929 delete newType->aggInst.aggregate->aggregate.fields; 929 930 newType->aggInst.aggregate->aggregate.fields = nullptr; 931 newType->aggInst.aggregate->aggregate.body = false; 930 932 } // if 931 933 // don't hoist twice -
src/Parser/ExpressionNode.cc
re16294d rb03eed6 211 211 if ( Unsigned && size < 2 ) { // hh or h, less than int ? 212 212 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunately eliminates warnings for large values. 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 214 214 } else if ( lnth != -1 ) { // explicit length ? 215 215 if ( lnth == 5 ) { // int128 ? 216 216 size = 5; 217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 218 218 } else { 219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ) );219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ), false ); 220 220 } // if 221 221 } // if … … 285 285 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) ); 286 286 if ( lnth != -1 ) { // explicit length ? 287 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ) );287 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ), false ); 288 288 } // if 289 289 … … 408 408 if ( dynamic_cast< VoidType * >( targetType ) ) { 409 409 delete targetType; 410 return new CastExpr( maybeMoveBuild< Expression >(expr_node) );410 return new CastExpr( maybeMoveBuild< Expression >(expr_node), false ); 411 411 } else { 412 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType );412 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType, false ); 413 413 } // if 414 414 } // build_cast 415 416 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node ) { 417 return new KeywordCastExpr( maybeMoveBuild< Expression >(expr_node), target ); 418 } 415 419 416 420 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ) { -
src/Parser/ParseNode.h
re16294d rb03eed6 179 179 180 180 Expression * build_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 181 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node ); 181 182 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 182 183 Expression * build_fieldSel( ExpressionNode * expr_node, Expression * member ); -
src/Parser/TypeData.cc
re16294d rb03eed6 490 490 switch ( td->kind ) { 491 491 case TypeData::Aggregate: 492 if ( ! toplevel && td->aggregate. fields) {492 if ( ! toplevel && td->aggregate.body ) { 493 493 ret = td->clone(); 494 494 } // if 495 495 break; 496 496 case TypeData::Enum: 497 if ( ! toplevel && td->enumeration. constants) {497 if ( ! toplevel && td->enumeration.body ) { 498 498 ret = td->clone(); 499 499 } // if -
src/Parser/parser.yy
re16294d rb03eed6 688 688 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 689 689 | '(' COROUTINE '&' ')' cast_expression // CFA 690 { SemanticError( yylloc, "coroutine cast is currently unimplemented." ); $$ = nullptr; }690 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 691 691 | '(' THREAD '&' ')' cast_expression // CFA 692 { SemanticError( yylloc, "monitor cast is currently unimplemented." ); $$ = nullptr; }692 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Thread, $5 ) ); } 693 693 | '(' MONITOR '&' ')' cast_expression // CFA 694 { SemanticError( yylloc, "thread cast is currently unimplemented." ); $$ = nullptr; }694 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Monitor, $5 ) ); } 695 695 // VIRTUAL cannot be opt because of look ahead issues 696 696 | '(' VIRTUAL ')' cast_expression // CFA
Note:
See TracChangeset
for help on using the changeset viewer.