Changeset 4e7f0f1 for src/SymTab


Ignore:
Timestamp:
Sep 7, 2016, 11:40:52 AM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
3b58d91
Parents:
e76acbe (diff), 02cea2d (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' into tuples

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    re76acbe r4e7f0f1  
    280280        }
    281281
     282        void addForwardDecl( FunctionDecl * functionDecl, std::list< Declaration * > & declsToAdd ) {
     283                FunctionDecl * decl = functionDecl->clone();
     284                delete decl->get_statements();
     285                decl->set_statements( NULL );
     286                declsToAdd.push_back( decl );
     287                decl->fixUniqueId();
     288        }
     289
    282290        void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd ) {
    283291                FunctionType *assignType = new FunctionType( Type::Qualifiers(), false );
     
    324332                copyCtorDecl->fixUniqueId();
    325333                dtorDecl->fixUniqueId();
     334
     335                if ( functionNesting == 0 ) {
     336                        // forward declare if top-level struct, so that
     337                        // type is complete as soon as its body ends
     338                        addForwardDecl( assignDecl, declsToAdd );
     339                        addForwardDecl( ctorDecl, declsToAdd );
     340                        addForwardDecl( copyCtorDecl, declsToAdd );
     341                        addForwardDecl( dtorDecl, declsToAdd );
     342                }
    326343
    327344                // create constructors which take each member type as a parameter.
  • src/SymTab/Validate.cc

    re76acbe r4e7f0f1  
    4040#include <list>
    4141#include <iterator>
     42#include "Common/ScopedMap.h"
    4243#include "Common/utility.h"
    4344#include "Common/UniqueName.h"
     
    4950#include "SynTree/Statement.h"
    5051#include "SynTree/TypeSubstitution.h"
    51 #include "GenPoly/ScopedMap.h"
    5252#include "Indexer.h"
    5353#include "FixFunction.h"
     
    164164
    165165                typedef std::unique_ptr<TypedefDecl> TypedefDeclPtr;
    166                 typedef GenPoly::ScopedMap< std::string, std::pair< TypedefDeclPtr, int > > TypedefMap;
     166                typedef ScopedMap< std::string, std::pair< TypedefDeclPtr, int > > TypedefMap;
    167167                typedef std::map< std::string, TypeDecl * > TypeDeclMap;
    168168                TypedefMap typedefNames;
Note: See TracChangeset for help on using the changeset viewer.