Changeset 5f98ce5 for src/ResolvExpr


Ignore:
Timestamp:
Jul 19, 2016, 7:09:30 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, 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:
40e636a
Parents:
2be1023
Message:

hoist non-constexpr array dimension into const variable in case of side effects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r2be1023 r5f98ce5  
    2424#include "SynTree/Initializer.h"
    2525#include "SymTab/Indexer.h"
     26#include "SymTab/Autogen.h"
    2627#include "Common/utility.h"
    2728#include "InitTweak/InitTweak.h"
     
    194195        void Resolver::visit( ArrayType * at ) {
    195196                if ( at->get_dimension() ) {
    196                         BasicType arrayLenType = BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt );
    197                         CastExpr *castExpr = new CastExpr( at->get_dimension(), arrayLenType.clone() );
     197                        CastExpr *castExpr = new CastExpr( at->get_dimension(), SymTab::SizeType->clone() );
    198198                        Expression *newExpr = findSingleExpression( castExpr, *this );
    199199                        delete at->get_dimension();
Note: See TracChangeset for help on using the changeset viewer.