Changeset a5f0529 for src/CodeGen


Ignore:
Timestamp:
Jul 26, 2017, 2:44:09 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
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:
2edd80ae
Parents:
b947fb2
Message:

Virtual casts have been added. They still require a lot of hand coded support to work but for simple cases it should be enough.

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rb947fb2 ra5f0529  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Jun  8 16:00:00 2017
    13 // Update Count     : 485
     12// Last Modified On : Tus Jul 25 15:29:00 2017
     13// Update Count     : 486
    1414//
    1515#include "CodeGenerator.h"
     
    594594        }
    595595
     596        void CodeGenerator::visit( VirtualCastExpr * castExpr ) {
     597                assertf( ! genC, "VirtualCastExpr should not reach code generation." );
     598                extension( castExpr );
     599                output << "(virtual ";
     600                castExpr->get_arg()->accept( *this );
     601                output << ")";
     602        }
     603
    596604        void CodeGenerator::visit( UntypedMemberExpr * memberExpr ) {
    597605                assertf( ! genC, "UntypedMemberExpr should not reach code generation." );
  • src/CodeGen/CodeGenerator.h

    rb947fb2 ra5f0529  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:16:21 2017
    13 // Update Count     : 53
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Jul 25 25:30:00 2017
     13// Update Count     : 54
    1414//
    1515
     
    5959                virtual void visit( AddressExpr *addressExpr );
    6060                virtual void visit( CastExpr *castExpr );
     61                virtual void visit( VirtualCastExpr *castExpr );
    6162                virtual void visit( UntypedMemberExpr *memberExpr );
    6263                virtual void visit( MemberExpr *memberExpr );
Note: See TracChangeset for help on using the changeset viewer.