Ignore:
Timestamp:
Mar 3, 2016, 1:28:56 PM (10 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
3627356
Parents:
9d7b3ea (diff), 4040425 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r9d7b3ea r36ebd03  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 14 14:46:32 2015
    13 // Update Count     : 126
     12// Last Modified On : Wed Mar  2 17:26:24 2016
     13// Update Count     : 134
    1414//
    1515
     
    3434const char *DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "" };
    3535const char *DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic" };
    36 const char *DeclarationNode::basicTypeName[] = { "char", "int", "float", "double", "void", "_Bool", "_Complex", "_Imaginary" };
     36const char *DeclarationNode::basicTypeName[] = { "char", "int", "float", "double", "void", "_Bool", "_Complex", "_Imaginary", };
    3737const char *DeclarationNode::modifierName[]  = { "signed", "unsigned", "short", "long" };
    3838const char *DeclarationNode::aggregateName[] = { "struct", "union", "context" };
    3939const char *DeclarationNode::typeClassName[] = { "type", "dtype", "ftype" };
     40const char *DeclarationNode::builtinTypeName[] = { "__builtin_va_list" };
    4041
    4142UniqueName DeclarationNode::anonymous( "__anonymous" );
     
    147148        newnode->type = new TypeData( TypeData::Basic );
    148149        newnode->type->basic->typeSpec.push_back( bt );
     150        return newnode;
     151}
     152
     153DeclarationNode *DeclarationNode::newBuiltinType( BuiltinType bt ) {
     154        DeclarationNode *newnode = new DeclarationNode;
     155        newnode->type = new TypeData( TypeData::Builtin );
     156        newnode->type->builtin->type = bt;
    149157        return newnode;
    150158}
     
    215223        DeclarationNode *newnode = new DeclarationNode;
    216224        newnode->name = assign_strptr( name );
    217         // do something with the constant
     225        newnode->enumeratorValue = constant;
    218226        return newnode;
    219227}
     
    243251}
    244252
    245 DeclarationNode *DeclarationNode::newContext( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) {
     253DeclarationNode *DeclarationNode::newTrait( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) {
    246254        DeclarationNode *newnode = new DeclarationNode;
    247255        newnode->type = new TypeData( TypeData::Aggregate );
    248         newnode->type->aggregate->kind = Context;
     256        newnode->type->aggregate->kind = Trait;
    249257        newnode->type->aggregate->params = params;
    250258        newnode->type->aggregate->fields = asserts;
     
    253261}
    254262
    255 DeclarationNode *DeclarationNode::newContextUse( std::string *name, ExpressionNode *params ) {
     263DeclarationNode *DeclarationNode::newTraitUse( std::string *name, ExpressionNode *params ) {
    256264        DeclarationNode *newnode = new DeclarationNode;
    257265        newnode->type = new TypeData( TypeData::AggregateInst );
    258266        newnode->type->aggInst->aggregate = new TypeData( TypeData::Aggregate );
    259         newnode->type->aggInst->aggregate->aggregate->kind = Context;
     267        newnode->type->aggInst->aggregate->aggregate->kind = Trait;
    260268        newnode->type->aggInst->aggregate->aggregate->name = assign_strptr( name );
    261269        newnode->type->aggInst->params = params;
     
    794802                        errors.append( e );
    795803                } // try
    796                 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );
     804                cur = dynamic_cast<DeclarationNode *>( cur->get_link() );
    797805        } // while
    798806        if ( ! errors.isEmpty() ) {
     
    881889                          ret = new UnionInstType( type->buildQualifiers(), type->aggregate->name );
    882890                          break;
    883                         case DeclarationNode::Context:
    884                           ret = new ContextInstType( type->buildQualifiers(), type->aggregate->name );
     891                        case DeclarationNode::Trait:
     892                          ret = new TraitInstType( type->buildQualifiers(), type->aggregate->name );
    885893                          break;
    886894                        default:
Note: See TracChangeset for help on using the changeset viewer.