Changeset 68cd1ce for src/SymTab


Ignore:
Timestamp:
Jun 13, 2015, 8:30:25 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
a1d5d2a
Parents:
7bcf74e
Message:

unify and fix storage class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r7bcf74e r68cd1ce  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  8 17:19:35 2015
    13 // Update Count     : 22
     12// Last Modified On : Sat Jun 13 08:06:13 2015
     13// Update Count     : 26
    1414//
    1515
     
    4545#include "SynTree/Type.h"
    4646#include "SynTree/Statement.h"
     47#include "SynTree/TypeSubstitution.h"
    4748#include "Indexer.h"
    48 #include "SynTree/TypeSubstitution.h"
    4949#include "FixFunction.h"
    5050#include "ImplementationType.h"
     
    506506                if ( ! array->get_dimension() ) return;
    507507 
    508                 ObjectDecl *index = new ObjectDecl( indexName.newName(), Declaration::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 );
     508                ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 );
    509509                *out++ = new DeclStmt( noLabels, index );
    510510 
     
    544544                FunctionType *assignType = new FunctionType( Type::Qualifiers(), false );
    545545 
    546                 ObjectDecl *returnVal = new ObjectDecl( "", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );
     546                ObjectDecl *returnVal = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );
    547547                assignType->get_returnVals().push_back( returnVal );
    548548 
    549                 ObjectDecl *dstParam = new ObjectDecl( "_dst", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 );
     549                ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 );
    550550                assignType->get_parameters().push_back( dstParam );
    551551 
    552                 ObjectDecl *srcParam = new ObjectDecl( "_src", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 );
     552                ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 );
    553553                assignType->get_parameters().push_back( srcParam );
    554554
    555555                // Routines at global scope marked "static" to prevent multiple definitions is separate translation units
    556556                // because each unit generates copies of the default routines for each aggregate.
    557                 FunctionDecl *assignDecl = new FunctionDecl( "?=?", functionNesting > 0 ? Declaration::NoStorageClass : Declaration::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true );
     557                FunctionDecl *assignDecl = new FunctionDecl( "?=?", functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true );
    558558                assignDecl->fixUniqueId();
    559559 
     
    587587                FunctionType *assignType = new FunctionType( Type::Qualifiers(), false );
    588588 
    589                 ObjectDecl *returnVal = new ObjectDecl( "", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );
     589                ObjectDecl *returnVal = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );
    590590                assignType->get_returnVals().push_back( returnVal );
    591591 
    592                 ObjectDecl *dstParam = new ObjectDecl( "_dst", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 );
     592                ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 );
    593593                assignType->get_parameters().push_back( dstParam );
    594594 
    595                 ObjectDecl *srcParam = new ObjectDecl( "_src", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 );
     595                ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 );
    596596                assignType->get_parameters().push_back( srcParam );
    597597 
    598598                // Routines at global scope marked "static" to prevent multiple definitions is separate translation units
    599599                // because each unit generates copies of the default routines for each aggregate.
    600                 FunctionDecl *assignDecl = new FunctionDecl( "?=?",  functionNesting > 0 ? Declaration::NoStorageClass : Declaration::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true );
     600                FunctionDecl *assignDecl = new FunctionDecl( "?=?",  functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true );
    601601                assignDecl->fixUniqueId();
    602602 
     
    633633                TypeInstType *typeInst = new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), false );
    634634                typeInst->set_baseType( typeDecl );
    635                 ObjectDecl *src = new ObjectDecl( "_src", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, typeInst->clone(), 0 );
    636                 ObjectDecl *dst = new ObjectDecl( "_dst", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), typeInst->clone() ), 0 );
     635                ObjectDecl *src = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, typeInst->clone(), 0 );
     636                ObjectDecl *dst = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), typeInst->clone() ), 0 );
    637637                if ( typeDecl->get_base() ) {
    638638                        stmts = new CompoundStmt( std::list< Label >() );
     
    643643                } // if
    644644                FunctionType *type = new FunctionType( Type::Qualifiers(), false );
    645                 type->get_returnVals().push_back( new ObjectDecl( "", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, typeInst, 0 ) );
     645                type->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, typeInst, 0 ) );
    646646                type->get_parameters().push_back( dst );
    647647                type->get_parameters().push_back( src );
    648                 FunctionDecl *func = new FunctionDecl( "?=?", Declaration::NoStorageClass, LinkageSpec::AutoGen, type, stmts, false );
     648                FunctionDecl *func = new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::AutoGen, type, stmts, false );
    649649                declsToAdd.push_back( func );
    650650        }
Note: See TracChangeset for help on using the changeset viewer.