Changes in / [6380f78:f4c2f1a]


Ignore:
Location:
src
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    r6380f78 rf4c2f1a  
    2020#include <vector>
    2121
    22 #include "GenericSubstitution.hpp"
    2322#include "Stmt.hpp"
    2423#include "Type.hpp"
    25 #include "TypeSubstitution.hpp"
    2624#include "Common/utility.h"
    2725#include "Common/SemanticError.h"
     
    159157        assert( aggregate->result );
    160158
    161         // take ownership of member type
    162         Type * res = result.set_and_mutate( mem->get_type() );
    163         // substitute aggregate generic parameters into member type
    164         genericSubsitution( aggregate->result ).apply( res );
    165         // ensure lvalue and appropriate restrictions from aggregate type
    166         res->set_lvalue( true );
    167         res->qualifiers |= aggregate->result->qualifiers;
    168         // ensure changes propegated back into result
    169         result = res;
     159        assert(!"unimplemented; need TypeSubstitution, genericSubstitution");
    170160}
    171161
  • src/AST/Node.hpp

    r6380f78 rf4c2f1a  
    9494std::ostream& operator<< ( std::ostream& out, const Node * node );
    9595
    96 /// Call a visitor on a possibly-null node
    97 template<typename node_t>
    98 auto maybe_accept( const node_t * n, Visitor & v ) -> decltype( n->accept(v) ) {
    99         return n ? n->accept( v ) : nullptr;
    100 }
    101 
    10296/// Base class for the smart pointer types
    10397/// should never really be used.
  • src/AST/Pass.hpp

    r6380f78 rf4c2f1a  
    223223};
    224224
    225 /// Apply a pass to an entire translation unit
    226225template<typename pass_t>
    227226void accept_all( std::list< ast::ptr<ast::Decl> > &, ast::Pass<pass_t> & visitor );
  • src/AST/TypeSubstitution.hpp

    r6380f78 rf4c2f1a  
    2525#include "Fwd.hpp"        // for UniqueId
    2626#include "ParseNode.hpp"
    27 #include "Type.hpp"       
     27#include "Type.hpp"       // for ptr<Type>
    2828#include "Common/SemanticError.h"  // for SemanticError
    2929#include "Visitor.hpp"
     
    165165        assert( input );
    166166        Pass<Substituter> sub( *this, false );
    167         input = strict_dynamic_cast< SynTreeClass * >( input->accept( sub ) );
     167        input = dynamic_cast< SynTreeClass * >( input->acceptMutator( sub ) );
     168        assert( input );
    168169///     std::cerr << "substitution result is: ";
    169170///     newType->print( std::cerr );
     
    176177        assert( input );
    177178        Pass<Substituter> sub( *this, true );
    178         input = strict_dynamic_cast< SynTreeClass * >( input->accept( sub ) );
     179        input = dynamic_cast< SynTreeClass * >( input->acceptMutator( sub ) );
     180        assert( input );
    179181///     std::cerr << "substitution result is: ";
    180182///     newType->print( std::cerr );
  • src/AST/module.mk

    r6380f78 rf4c2f1a  
    2121        AST/DeclReplacer.cpp \
    2222        AST/Expr.cpp \
    23         AST/GenericSubstitution.cpp \
    2423        AST/Init.cpp \
    2524        AST/LinkageSpec.cpp \
  • src/AST/porting.md

    r6380f78 rf4c2f1a  
    3838
    3939`N->print(std::ostream&)` is a visitor now, port these methods to `ast::Print` class
    40 * **TODO** `Declaration::printShort` should also be integrated
     40* **TODO** write this visitor
     41* **TODO** write `std::ostream& operator<< ( std::ostream& out, const Node* node )` in `Node.hpp` in terms of `ast::Print`
     42* `Declaration::printShort` should also be integrated
    4143
    4244`clone` is private to `Node` now
     
    206208
    207209`CompoundStmt`
     210* **TODO** port copy operator
     211  * Needs to be an almost-shallow clone, where the declarations are cloned only if needed
     212  * **TODO** port `DeclReplacer`
    208213* Still a `std::list` for children, rather than `std::vector`
    209214  * allows more-efficient splicing for purposes of later code generation
     
    224229  * `getAggr()` => `aggr()`
    225230    * also now returns `const AggregateDecl *`
    226 * `genericSubstitution()` moved to own visitor in `AST/GenericSubstitution.hpp`
     231* `genericSubstitution()` moved to own visitor in `AST/GenericSubstitution.hpp` **TODO** write
    227232
    228233`BasicType`
  • src/Makefile.in

    r6380f78 rf4c2f1a  
    167167am__objects_1 = AST/Attribute.$(OBJEXT) AST/Convert.$(OBJEXT) \
    168168        AST/Decl.$(OBJEXT) AST/DeclReplacer.$(OBJEXT) \
    169         AST/Expr.$(OBJEXT) AST/GenericSubstitution.$(OBJEXT) \
    170         AST/Init.$(OBJEXT) AST/LinkageSpec.$(OBJEXT) \
    171         AST/Node.$(OBJEXT) AST/Pass.$(OBJEXT) AST/Print.$(OBJEXT) \
    172         AST/Stmt.$(OBJEXT) AST/Type.$(OBJEXT) \
    173         AST/TypeSubstitution.$(OBJEXT)
     169        AST/Expr.$(OBJEXT) AST/Init.$(OBJEXT) \
     170        AST/LinkageSpec.$(OBJEXT) AST/Node.$(OBJEXT) \
     171        AST/Pass.$(OBJEXT) AST/Print.$(OBJEXT) AST/Stmt.$(OBJEXT) \
     172        AST/Type.$(OBJEXT) AST/TypeSubstitution.$(OBJEXT)
    174173am__objects_2 = CodeGen/CodeGenerator.$(OBJEXT) \
    175174        CodeGen/FixMain.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \
     
    575574        AST/DeclReplacer.cpp \
    576575        AST/Expr.cpp \
    577         AST/GenericSubstitution.cpp \
    578576        AST/Init.cpp \
    579577        AST/LinkageSpec.cpp \
     
    741739        AST/$(DEPDIR)/$(am__dirstamp)
    742740AST/Expr.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    743 AST/GenericSubstitution.$(OBJEXT): AST/$(am__dirstamp) \
    744         AST/$(DEPDIR)/$(am__dirstamp)
    745741AST/Init.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    746742AST/LinkageSpec.$(OBJEXT): AST/$(am__dirstamp) \
     
    11771173@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/DeclReplacer.Po@am__quote@
    11781174@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Expr.Po@am__quote@
    1179 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/GenericSubstitution.Po@am__quote@
    11801175@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Init.Po@am__quote@
    11811176@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/LinkageSpec.Po@am__quote@
Note: See TracChangeset for help on using the changeset viewer.