Changeset d63eeb0 for src/CodeGen


Ignore:
Timestamp:
Feb 9, 2016, 3:25:05 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
7528ba1
Parents:
771b3c3 (diff), bd85400 (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' into ctor

Conflicts:

src/CodeGen/CodeGenerator.cc
src/GenPoly/Box.cc
src/Makefile.in
src/Parser/ParseNode.h
src/Parser/parser.cc
src/Parser/parser.yy
src/SymTab/Validate.cc
src/SynTree/Initializer.h
src/SynTree/ObjectDecl.cc
src/SynTree/Visitor.h
src/main.cc

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r771b3c3 rd63eeb0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Jan 20 12:59:17 2016
    13 // Update Count     : 254
     12// Last Modified On : Tue Feb 09 13:24:40 2016
     13// Update Count     : 255
    1414//
    1515
     
    2626#include "SynTree/Statement.h"
    2727
    28 #include "utility.h"
    29 #include "UnimplementedError.h"
     28#include "Common/utility.h"
     29#include "Common/UnimplementedError.h"
    3030
    3131#include "CodeGenerator.h"
     
    458458        }
    459459
    460         void CodeGenerator::visit( AlignofExpr *sizeofExpr ) {
     460        void CodeGenerator::visit( AlignofExpr *alignofExpr ) {
    461461                // use GCC extension to avoid bumping std to C11
    462462                output << "__alignof__(";
    463                 if ( sizeofExpr->get_isType() ) {
    464                         output << genType( sizeofExpr->get_type(), "" );
    465                 } else {
    466                         sizeofExpr->get_expr()->accept( *this );
    467                 } // if
     463                if ( alignofExpr->get_isType() ) {
     464                        output << genType( alignofExpr->get_type(), "" );
     465                } else {
     466                        alignofExpr->get_expr()->accept( *this );
     467                } // if
     468                output << ")";
     469        }
     470
     471        void CodeGenerator::visit( UntypedOffsetofExpr *offsetofExpr ) {
     472                assert( false );
     473        }
     474
     475        void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) {
     476                // use GCC builtin
     477                output << "__builtin_offsetof(";
     478                output << genType( offsetofExpr->get_type(), "" );
     479                output << ", " << mangleName( offsetofExpr->get_member() );
    468480                output << ")";
    469481        }
  • src/CodeGen/CodeGenerator.h

    r771b3c3 rd63eeb0  
    6161                virtual void visit( SizeofExpr *sizeofExpr );
    6262                virtual void visit( AlignofExpr *alignofExpr );
     63                virtual void visit( UntypedOffsetofExpr *offsetofExpr );
     64                virtual void visit( OffsetofExpr *offsetofExpr );
    6365                virtual void visit( LogicalExpr *logicalExpr );
    6466                virtual void visit( ConditionalExpr *conditionalExpr );
Note: See TracChangeset for help on using the changeset viewer.