Ignore:
Timestamp:
Jun 8, 2023, 3:19:43 PM (12 months ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT
Parents:
044ae62
Message:

Finish Adt POC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.proto.h

    r044ae62 rfa2c005  
    256256        cloneAll( decl->parameters, fwd->parameters );
    257257
    258         // Experimental
    259         for ( const StructDecl * ctor : fwd->data_constructors ) {
    260                 indexer_impl_addStructFwd( pass, 0, ctor );
    261         }
    262 
    263258        pass.indexer.addAdt( fwd );
    264259}
     
    288283
    289284template<typename pass_type>
     285static inline auto indexer_impl_addAdt( pass_type & pass, int, const std::string & str ) -> decltype( pass.indexer.addAdt( str ), void() ) {
     286        assert( false );
     287        if ( ! pass.indexer.lookupAdt( str )) {
     288                pass.indexer.addAdt( str );
     289        }
     290}
     291
     292template<typename pass_type>
     293static inline auto indexer_impl_addAdt( pass_type &, long, const std::string & ) {
     294        assert( false );
     295}
     296
     297template<typename pass_type>
    290298static inline auto indexer_impl_addUnion( pass_type & pass, int, const std::string & str ) -> decltype( pass.indexer.addUnion( str ), void() ) {
    291299        if ( ! pass.indexer.lookupUnion( str ) ) {
Note: See TracChangeset for help on using the changeset viewer.