Ignore:
Timestamp:
Aug 22, 2017, 7:31:52 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
9aaac6e9
Parents:
fc56cdbf (diff), b3d413b (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 references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    rfc56cdbf r8135d4c  
    1414//
    1515
    16 #include <list>
    17 #include <iterator>
    18 #include <algorithm>
    19 #include <functional>
    20 #include <cassert>
    21 #include <unordered_map>
    22 #include <utility>
    23 #include <vector>
    24 
     16#include <algorithm>               // for copy
     17#include <cassert>                 // for safe_dynamic_cast, assert, assertf
     18#include <iostream>                // for operator<<, cerr, ostream, endl
     19#include <iterator>                // for back_insert_iterator, back_inserter
     20#include <list>                    // for _List_iterator, list, _List_const_...
     21#include <map>                     // for _Rb_tree_iterator, map, _Rb_tree_c...
     22#include <memory>                  // for allocator_traits<>::value_type
     23#include <utility>                 // for pair
     24
     25#include "Alternative.h"           // for AltList, Alternative
    2526#include "AlternativeFinder.h"
    26 #include "Alternative.h"
    27 #include "Cost.h"
    28 #include "typeops.h"
    29 #include "Unify.h"
    30 #include "RenameVars.h"
    31 #include "SynTree/Type.h"
    32 #include "SynTree/Declaration.h"
    33 #include "SynTree/Expression.h"
    34 #include "SynTree/Initializer.h"
    35 #include "SynTree/Visitor.h"
    36 #include "SymTab/Indexer.h"
    37 #include "SymTab/Mangler.h"
    38 #include "SynTree/TypeSubstitution.h"
    39 #include "SymTab/Validate.h"
    40 #include "Tuples/Tuples.h"
    41 #include "Tuples/Explode.h"
    42 #include "Common/utility.h"
    43 #include "InitTweak/InitTweak.h"
    44 #include "InitTweak/GenInit.h"
    45 #include "ResolveTypeof.h"
    46 #include "Resolver.h"
     27#include "Common/SemanticError.h"  // for SemanticError
     28#include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
     29#include "Cost.h"                  // for Cost, Cost::zero, operator<<, Cost...
     30#include "InitTweak/InitTweak.h"   // for getFunctionName
     31#include "RenameVars.h"            // for RenameVars, global_renamer
     32#include "ResolveTypeof.h"         // for resolveTypeof
     33#include "Resolver.h"              // for resolveStmtExpr
     34#include "SymTab/Indexer.h"        // for Indexer
     35#include "SymTab/Mangler.h"        // for Mangler
     36#include "SymTab/Validate.h"       // for validateType
     37#include "SynTree/Constant.h"      // for Constant
     38#include "SynTree/Declaration.h"   // for DeclarationWithType, TypeDecl, Dec...
     39#include "SynTree/Expression.h"    // for Expression, CastExpr, NameExpr
     40#include "SynTree/Initializer.h"   // for SingleInit, operator<<, Designation
     41#include "SynTree/SynTree.h"       // for UniqueId
     42#include "SynTree/Type.h"          // for Type, FunctionType, PointerType
     43#include "Tuples/Explode.h"        // for explode
     44#include "Tuples/Tuples.h"         // for isTtype, handleTupleAssignment
     45#include "Unify.h"                 // for unify
     46#include "typeops.h"               // for adjustExprType, polyCost, castCost
    4747
    4848extern bool resolvep;
     
    979979        void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) {
    980980                if ( sizeofExpr->get_isType() ) {
    981                         // xxx - resolveTypeof?
    982                         alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) );
     981                        Type * newType = sizeofExpr->get_type()->clone();
     982                        alternatives.push_back( Alternative( new SizeofExpr( resolveTypeof( newType, indexer ) ), env, Cost::zero ) );
    983983                } else {
    984984                        // find all alternatives for the argument to sizeof
     
    10001000        void AlternativeFinder::visit( AlignofExpr *alignofExpr ) {
    10011001                if ( alignofExpr->get_isType() ) {
    1002                         // xxx - resolveTypeof?
    1003                         alternatives.push_back( Alternative( alignofExpr->clone(), env, Cost::zero ) );
     1002                        Type * newType = alignofExpr->get_type()->clone();
     1003                        alternatives.push_back( Alternative( new AlignofExpr( resolveTypeof( newType, indexer ) ), env, Cost::zero ) );
    10041004                } else {
    10051005                        // find all alternatives for the argument to sizeof
Note: See TracChangeset for help on using the changeset viewer.