Changeset 7ff30d07 for src/CodeGen


Ignore:
Timestamp:
Jun 14, 2016, 1:23:18 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
545ef59, c738ca4, ee51534
Parents:
6cbc25a (diff), c8c03683 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

Conflicts:

Makefile.in
aclocal.m4
configure
src/Makefile.in
src/Tests/Context.c
src/driver/Makefile.in
src/examples/Makefile.in
src/examples/ctxts.c
src/examples/esskaykay.c
src/libcfa/Makefile.in

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r6cbc25a r7ff30d07  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 16:01:00 2016
    13 // Update Count     : 255
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jun  9 13:21:00 2016
     13// Update Count     : 256
    1414//
    1515
     
    251251        //*** Expressions
    252252        void CodeGenerator::visit( ApplicationExpr *applicationExpr ) {
     253                extension( applicationExpr );
    253254                if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
    254255                        OperatorInfo opInfo;
     
    366367
    367368        void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
     369                extension( untypedExpr );
    368370                if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
    369371                        OperatorInfo opInfo;
     
    450452
    451453        void CodeGenerator::visit( NameExpr *nameExpr ) {
     454                extension( nameExpr );
    452455                OperatorInfo opInfo;
    453456                if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
     
    460463
    461464        void CodeGenerator::visit( AddressExpr *addressExpr ) {
     465                extension( addressExpr );
    462466                output << "(&";
    463467                // this hack makes sure that we don't convert "constant_zero" to "0" if we're taking its address
     
    471475
    472476        void CodeGenerator::visit( CastExpr *castExpr ) {
     477                extension( castExpr );
    473478                output << "(";
    474479                if ( castExpr->get_results().empty() ) {
     
    493498
    494499        void CodeGenerator::visit( MemberExpr *memberExpr ) {
     500                extension( memberExpr );
    495501                memberExpr->get_aggregate()->accept( *this );
    496502                output << "." << mangleName( memberExpr->get_member() );
     
    498504
    499505        void CodeGenerator::visit( VariableExpr *variableExpr ) {
     506                extension( variableExpr );
    500507                OperatorInfo opInfo;
    501508                if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( variableExpr->get_var()->get_name(), opInfo ) && opInfo.type == OT_CONSTANT ) {
     
    508515        void CodeGenerator::visit( ConstantExpr *constantExpr ) {
    509516                assert( constantExpr->get_constant() );
     517                extension( constantExpr );
    510518                constantExpr->get_constant()->accept( *this );
    511519        }
    512520
    513521        void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
     522                extension( sizeofExpr );
    514523                output << "sizeof(";
    515524                if ( sizeofExpr->get_isType() ) {
     
    522531
    523532        void CodeGenerator::visit( AlignofExpr *alignofExpr ) {
     533                extension( alignofExpr );
    524534                // use GCC extension to avoid bumping std to C11
    525535                output << "__alignof__(";
     
    537547
    538548        void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) {
     549                extension( offsetofExpr );
    539550                // use GCC builtin
    540551                output << "__builtin_offsetof(";
     
    549560
    550561        void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
     562                extension( logicalExpr );
    551563                output << "(";
    552564                logicalExpr->get_arg1()->accept( *this );
     
    561573
    562574        void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
     575                extension( conditionalExpr );
    563576                output << "(";
    564577                conditionalExpr->get_arg1()->accept( *this );
     
    571584
    572585        void CodeGenerator::visit( CommaExpr *commaExpr ) {
     586                extension( commaExpr );
    573587                output << "(";
    574588                commaExpr->get_arg1()->accept( *this );
     
    583597
    584598        void CodeGenerator::visit( AsmExpr *asmExpr ) {
     599                extension( asmExpr );
    585600                if ( asmExpr->get_inout() ) {
    586601                        output << "[ ";
  • src/CodeGen/CodeGenerator.h

    r6cbc25a r7ff30d07  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:32:24 2016
    13 // Update Count     : 28
     12// Last Modified On : Thu Jun  9 13:15:58 2016
     13// Update Count     : 29
    1414//
    1515
     
    9696                        std::ostream& operator()(std::ostream & os);
    9797                };
     98
     99                void extension( Expression *expr ) {
     100                        if ( expr->get_extension() ) {
     101                                output << "__extension__ ";
     102                        } // if
     103                } // extension
    98104          private:
    99105
Note: See TracChangeset for help on using the changeset viewer.