Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r07de76b r033ff37  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 21:39:32 2019
    13 // Update Count     : 33
     12// Last Modified On : Thu Jul 25 22:21:46 2019
     13// Update Count     : 13
    1414//
    1515
     
    245245                auto decl = new StructDecl(
    246246                        node->name,
    247                         (AggregateDecl::Aggregate)node->kind,
     247                        node->kind,
    248248                        get<Attribute>().acceptL( node->attributes ),
    249249                        LinkageSpec::Spec( node->linkage.val )
     
    675675
    676676        const ast::Expr * visit( const ast::KeywordCastExpr * node ) override final {
    677                 AggregateDecl::Aggregate castTarget = (AggregateDecl::Aggregate)node->target;
    678                 assert( AggregateDecl::Generator <= castTarget && castTarget <= AggregateDecl::Thread );
     677                KeywordCastExpr::Target castTarget = KeywordCastExpr::NUMBER_OF_TARGETS;
     678                switch (node->target) {
     679                        case ast::KeywordCastExpr::Coroutine:
     680                                castTarget = KeywordCastExpr::Coroutine;
     681                                break;
     682                        case ast::KeywordCastExpr::Thread:
     683                                castTarget = KeywordCastExpr::Thread;
     684                                break;
     685                        case ast::KeywordCastExpr::Monitor:
     686                                castTarget = KeywordCastExpr::Monitor;
     687                                break;
     688                        default:
     689                                break;
     690                }
     691                assert ( castTarget < KeywordCastExpr::NUMBER_OF_TARGETS );
    679692                auto expr = visitBaseExpr( node,
    680693                        new KeywordCastExpr(
     
    874887                auto expr = visitBaseExpr( node,
    875888                        new AsmExpr(
    876                                 new std::string(node->inout),
     889                                get<Expression>().accept1(node->inout),
    877890                                get<Expression>().accept1(node->constraint),
    878891                                get<Expression>().accept1(node->operand)
     
    12231236                                cv( node ),
    12241237                                node->name,
    1225                                 node->kind == ast::TypeDecl::Ftype,
     1238                                node->kind == ast::TypeVar::Ftype,
    12261239                                get<Attribute>().acceptL( node->attributes )
    12271240                        };
     
    14911504                        old->location,
    14921505                        old->name,
    1493                         (ast::AggregateDecl::Aggregate)old->kind,
     1506                        old->kind,
    14941507                        GET_ACCEPT_V(attributes, Attribute),
    14951508                        { old->linkage.val }
     
    15781591                        { old->storageClasses.val },
    15791592                        GET_ACCEPT_1(base, Type),
    1580                         (ast::TypeDecl::Kind)(unsigned)old->kind,
     1593                        (ast::TypeVar::Kind)(unsigned)old->kind,
    15811594                        old->sized,
    15821595                        GET_ACCEPT_1(init, Type)
     
    20322045        }
    20332046
    2034         virtual void visit( const KeywordCastExpr * old ) override final {
    2035                 ast::AggregateDecl::Aggregate castTarget = (ast::AggregateDecl::Aggregate)old->target;
    2036                 assert( ast::AggregateDecl::Generator <= castTarget && castTarget <= ast::AggregateDecl::Thread );
     2047        virtual void visit( const KeywordCastExpr * old) override final {
     2048                ast::KeywordCastExpr::Target castTarget = ast::KeywordCastExpr::NUMBER_OF_TARGETS;
     2049                switch (old->target) {
     2050                        case KeywordCastExpr::Coroutine:
     2051                                castTarget = ast::KeywordCastExpr::Coroutine;
     2052                                break;
     2053                        case KeywordCastExpr::Thread:
     2054                                castTarget = ast::KeywordCastExpr::Thread;
     2055                                break;
     2056                        case KeywordCastExpr::Monitor:
     2057                                castTarget = ast::KeywordCastExpr::Monitor;
     2058                                break;
     2059                        default:
     2060                                break;
     2061                }
     2062                assert ( castTarget < ast::KeywordCastExpr::NUMBER_OF_TARGETS );
    20372063                this->node = visitBaseExpr( old,
    20382064                        new ast::KeywordCastExpr(
     
    22322258                        new ast::AsmExpr(
    22332259                                old->location,
    2234                                 old->inout,
     2260                                GET_ACCEPT_1(inout, Expr),
    22352261                                GET_ACCEPT_1(constraint, Expr),
    22362262                                GET_ACCEPT_1(operand, Expr)
     
    25612587                        ty = new ast::TypeInstType{
    25622588                                old->name,
    2563                                 old->isFtype ? ast::TypeDecl::Ftype : ast::TypeDecl::Dtype,
     2589                                old->isFtype ? ast::TypeVar::Ftype : ast::TypeVar::Dtype,
    25642590                                cv( old ),
    25652591                                GET_ACCEPT_V( attributes, Attribute )
Note: See TracChangeset for help on using the changeset viewer.