Ignore:
Timestamp:
Mar 8, 2024, 12:25:49 AM (4 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
266732e
Parents:
06601401 (diff), 169496e1 (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

    r06601401 r03606ce  
    177177}
    178178
     179DeclarationNode * DeclarationNode::newFromTypeData( TypeData * type ) {
     180        DeclarationNode * newnode = new DeclarationNode;
     181        newnode->type = type;
     182        return newnode;
     183} // DeclarationNode::newFromTypeData
     184
    179185DeclarationNode * DeclarationNode::newStorageClass( ast::Storage::Classes sc ) {
    180186        DeclarationNode * newnode = new DeclarationNode;
     
    188194        return newnode;
    189195} // DeclarationNode::newFuncSpecifier
    190 
    191 DeclarationNode * DeclarationNode::newTypeQualifier( ast::CV::Qualifiers tq ) {
    192         DeclarationNode * newnode = new DeclarationNode;
    193         newnode->type = new TypeData();
    194         newnode->type->qualifiers = tq;
    195         return newnode;
    196 } // DeclarationNode::newQualifier
    197 
    198 DeclarationNode * DeclarationNode::newBasicType( BasicType bt ) {
    199         DeclarationNode * newnode = new DeclarationNode;
    200         newnode->type = new TypeData( TypeData::Basic );
    201         newnode->type->basictype = bt;
    202         return newnode;
    203 } // DeclarationNode::newBasicType
    204 
    205 DeclarationNode * DeclarationNode::newComplexType( ComplexType ct ) {
    206         DeclarationNode * newnode = new DeclarationNode;
    207         newnode->type = new TypeData( TypeData::Basic );
    208         newnode->type->complextype = ct;
    209         return newnode;
    210 } // DeclarationNode::newComplexType
    211 
    212 DeclarationNode * DeclarationNode::newSignedNess( Signedness sn ) {
    213         DeclarationNode * newnode = new DeclarationNode;
    214         newnode->type = new TypeData( TypeData::Basic );
    215         newnode->type->signedness = sn;
    216         return newnode;
    217 } // DeclarationNode::newSignedNess
    218 
    219 DeclarationNode * DeclarationNode::newLength( Length lnth ) {
    220         DeclarationNode * newnode = new DeclarationNode;
    221         newnode->type = new TypeData( TypeData::Basic );
    222         newnode->type->length = lnth;
    223         return newnode;
    224 } // DeclarationNode::newLength
    225 
    226 DeclarationNode * DeclarationNode::newForall( DeclarationNode * forall ) {
    227         DeclarationNode * newnode = new DeclarationNode;
    228         newnode->type = new TypeData( TypeData::Unknown );
    229         newnode->type->forall = forall;
    230         return newnode;
    231 } // DeclarationNode::newForall
    232 
    233 DeclarationNode * DeclarationNode::newFromGlobalScope() {
    234         DeclarationNode * newnode = new DeclarationNode;
    235         newnode->type = new TypeData( TypeData::GlobalScope );
    236         return newnode;
    237 }
    238 
    239 DeclarationNode * DeclarationNode::newQualifiedType( DeclarationNode * parent, DeclarationNode * child) {
    240         DeclarationNode * newnode = new DeclarationNode;
    241         newnode->type = new TypeData( TypeData::Qualified );
    242         newnode->type->qualified.parent = parent->type;
    243         newnode->type->qualified.child = child->type;
    244         parent->type = nullptr;
    245         child->type = nullptr;
    246         delete parent;
    247         delete child;
    248         return newnode;
    249 }
    250196
    251197DeclarationNode * DeclarationNode::newAggregate( ast::AggregateDecl::Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {
     
    312258}
    313259
    314 DeclarationNode * DeclarationNode::newFromTypedef( const string * name ) {
    315         DeclarationNode * newnode = new DeclarationNode;
    316         newnode->type = new TypeData( TypeData::SymbolicInst );
    317         newnode->type->symbolic.name = name;
    318         newnode->type->symbolic.isTypedef = true;
    319         newnode->type->symbolic.params = nullptr;
    320         return newnode;
    321 } // DeclarationNode::newFromTypedef
    322 
    323 DeclarationNode * DeclarationNode::newFromTypeGen( const string * name, ExpressionNode * params ) {
    324         DeclarationNode * newnode = new DeclarationNode;
    325         newnode->type = new TypeData( TypeData::SymbolicInst );
    326         newnode->type->symbolic.name = name;
    327         newnode->type->symbolic.isTypedef = false;
    328         newnode->type->symbolic.actuals = params;
    329         return newnode;
    330 } // DeclarationNode::newFromTypeGen
    331 
    332260DeclarationNode * DeclarationNode::newTypeParam( ast::TypeDecl::Kind tc, const string * name ) {
    333261        DeclarationNode * newnode = newName( name );
     
    423351        return newnode;
    424352}
    425 
    426 DeclarationNode * DeclarationNode::newVtableType( DeclarationNode * decl ) {
    427         DeclarationNode * newnode = new DeclarationNode;
    428         newnode->type = new TypeData( TypeData::Vtable );
    429         newnode->setBase( decl->type );
    430         return newnode;
    431 }
    432 
    433 DeclarationNode * DeclarationNode::newBuiltinType( BuiltinType bt ) {
    434         DeclarationNode * newnode = new DeclarationNode;
    435         newnode->type = new TypeData( TypeData::Builtin );
    436         newnode->type->builtintype = bt;
    437         return newnode;
    438 } // DeclarationNode::newBuiltinType
    439353
    440354DeclarationNode * DeclarationNode::newFunction( const string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) {
Note: See TracChangeset for help on using the changeset viewer.