Changeset 68cd1ce for src/GenPoly


Ignore:
Timestamp:
Jun 13, 2015, 8:30:25 AM (10 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

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r7bcf74e r68cd1ce  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 07:31:41 2015
    13 // Update Count     : 1
     12// Last Modified On : Sat Jun 13 07:13:46 2015
     13// Update Count     : 3
    1414//
    1515
     
    2626#include "ScrubTyVars.h"
    2727
    28 #include "SynTree/Declaration.h"
     28#include "Parser/ParseNode.h"
     29
    2930#include "SynTree/Type.h"
    3031#include "SynTree/Expression.h"
     
    3233#include "SynTree/Statement.h"
    3334#include "SynTree/Mutator.h"
     35
    3436#include "ResolvExpr/TypeEnvironment.h"
     37
    3538#include "SymTab/Mangler.h"
    3639
     
    282285
    283286                ObjectDecl *Pass1::makeTemporary( Type *type ) {
    284                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Declaration::NoStorageClass, LinkageSpec::C, 0, type, 0 );
     287                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, 0 );
    285288                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    286289                        return newObj;
     
    362365                                        arg = new AddressExpr( arg );
    363366                                } else {
    364                                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Declaration::NoStorageClass, LinkageSpec::C, 0, arg->get_results().front()->clone(), 0 );
     367                                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, arg->get_results().front()->clone(), 0 );
    365368                                        newObj->get_type()->get_qualifiers() = Type::Qualifiers();
    366369                                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
     
    433436                                makeRetParm( adapter );
    434437                        } // if
    435                         adapter->get_parameters().push_front( new ObjectDecl( "", Declaration::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
     438                        adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
    436439                        return adapter;
    437440                }
     
    521524                        adapterBody->get_kids().push_back( bodyStmt );
    522525                        std::string adapterName = makeAdapterName( mangleName );
    523                         return new FunctionDecl( adapterName, Declaration::NoStorageClass, LinkageSpec::C, adapterType, adapterBody, false );
     526                        return new FunctionDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, adapterType, adapterBody, false );
    524527                }
    525528
     
    902905                                if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
    903906                                        std::string adapterName = makeAdapterName( mangleName );
    904                                         paramList.push_front( new ObjectDecl( adapterName, Declaration::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
     907                                        paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
    905908                                        adaptersDone.insert( adaptersDone.begin(), mangleName );
    906909                                }
     
    961964                        std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin();
    962965                        std::list< DeclarationWithType *> inferredParams;
    963                         ObjectDecl *newObj = new ObjectDecl( "", Declaration::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
    964 ///   ObjectDecl *newFunPtr = new ObjectDecl( "", Declaration::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 );
     966                        ObjectDecl *newObj = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
     967///   ObjectDecl *newFunPtr = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 );
    965968                        for ( std::list< TypeDecl *>::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) {
    966969                                ObjectDecl *thisParm;
  • src/GenPoly/Specialize.cc

    r7bcf74e r68cd1ce  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 07:55:09 2015
    13 // Update Count     : 4
     12// Last Modified On : Sat Jun 13 07:14:42 2015
     13// Update Count     : 5
    1414//
    1515
     
    1919#include "PolyMutator.h"
    2020
    21 #include "SynTree/Declaration.h"
     21#include "Parser/ParseNode.h"
     22
     23#include "SynTree/Expression.h"
    2224#include "SynTree/Statement.h"
    23 #include "SynTree/Expression.h"
    2425#include "SynTree/Type.h"
    2526#include "SynTree/TypeSubstitution.h"
     
    9697                                        newEnv.applyFree( newType );
    9798                                } // if
    98                                 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), Declaration::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( std::list< std::string >() ), false );
     99                                FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( std::list< std::string >() ), false );
    99100                                thunkFunc->fixUniqueId();
    100101
Note: See TracChangeset for help on using the changeset viewer.