Changeset fea3faa


Ignore:
Timestamp:
Jul 19, 2017, 11:48:01 AM (7 years ago)
Author:
Aaron Moss <a3moss@…>
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:
b826e6b
Parents:
6385d62
Message:

Strip bodies of generic structs pre-codegen [fixes #18]

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/VectorMap.h

    r6385d62 rfea3faa  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ScopedMap.h --
     7// VectorMap.h --
    88//
    99// Author           : Aaron B. Moss
  • src/GenPoly/Box.cc

    r6385d62 rfea3faa  
    202202                };
    203203
    204                 /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, and sizeof expressions of polymorphic types with the proper variable
     204                /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, sizeof expressions of polymorphic types with the proper variable, and strips fields from generic struct declarations.
    205205                class Pass3 final : public PolyMutator {
    206206                  public:
     
    210210                        using PolyMutator::mutate;
    211211                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     212                        virtual Declaration *mutate( StructDecl *structDecl ) override;
     213                        virtual Declaration *mutate( UnionDecl *unionDecl ) override;
    212214                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
    213215                        virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override;
     
    18571859                }
    18581860
     1861                /// Strips the members from a generic aggregate
     1862                void stripGenericMembers(AggregateDecl* decl) {
     1863                        if ( ! decl->get_parameters().empty() ) decl->get_members().clear();
     1864                }
     1865
     1866                Declaration *Pass3::mutate( StructDecl *structDecl ) {
     1867                        stripGenericMembers( structDecl );
     1868                        return structDecl;
     1869                }
     1870               
     1871                Declaration *Pass3::mutate( UnionDecl *unionDecl ) {
     1872                        stripGenericMembers( unionDecl );
     1873                        return unionDecl;
     1874                }
     1875
    18591876                TypeDecl * Pass3::mutate( TypeDecl *typeDecl ) {
    18601877//   Initializer *init = 0;
Note: See TracChangeset for help on using the changeset viewer.