Ignore:
Timestamp:
Aug 30, 2018, 1:00:41 PM (3 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
bcc0946
Parents:
a715b5c
Message:

Refactor FindSpecialDeclarations? and associated special declarations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/GenInit.cc

    ra715b5c r2bfc6b2  
    1515#include "GenInit.h"
    1616
    17 #include <stddef.h>                // for NULL
    18 #include <algorithm>               // for any_of
    19 #include <cassert>                 // for assert, strict_dynamic_cast, assertf
    20 #include <iterator>                // for back_inserter, inserter, back_inse...
    21 #include <list>                    // for _List_iterator, list
     17#include <stddef.h>                    // for NULL
     18#include <algorithm>                   // for any_of
     19#include <cassert>                     // for assert, strict_dynamic_cast, assertf
     20#include <iterator>                    // for back_inserter, inserter, back_inse...
     21#include <list>                        // for _List_iterator, list
    2222
    2323#include "CodeGen/OperatorTable.h"
    24 #include "Common/PassVisitor.h"    // for PassVisitor, WithGuards, WithShort...
    25 #include "Common/SemanticError.h"  // for SemanticError
    26 #include "Common/UniqueName.h"     // for UniqueName
    27 #include "Common/utility.h"        // for ValueGuard, maybeClone
    28 #include "GenPoly/GenPoly.h"       // for getFunctionType, isPolyType
    29 #include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::const_iter...
    30 #include "InitTweak.h"             // for isConstExpr, InitExpander, checkIn...
    31 #include "Parser/LinkageSpec.h"    // for isOverridable, C
     24#include "Common/PassVisitor.h"        // for PassVisitor, WithGuards, WithShort...
     25#include "Common/SemanticError.h"      // for SemanticError
     26#include "Common/UniqueName.h"         // for UniqueName
     27#include "Common/utility.h"            // for ValueGuard, maybeClone
     28#include "GenPoly/GenPoly.h"           // for getFunctionType, isPolyType
     29#include "GenPoly/ScopedSet.h"         // for ScopedSet, ScopedSet<>::const_iter...
     30#include "InitTweak.h"                 // for isConstExpr, InitExpander, checkIn...
     31#include "Parser/LinkageSpec.h"        // for isOverridable, C
    3232#include "ResolvExpr/Resolver.h"
    33 #include "SymTab/Autogen.h"        // for genImplicitCall, SizeType
    34 #include "SymTab/Mangler.h"        // for Mangler
    35 #include "SynTree/Declaration.h"   // for ObjectDecl, DeclarationWithType
    36 #include "SynTree/Expression.h"    // for VariableExpr, UntypedExpr, Address...
    37 #include "SynTree/Initializer.h"   // for ConstructorInit, SingleInit, Initi...
    38 #include "SynTree/Label.h"         // for Label
    39 #include "SynTree/Mutator.h"       // for mutateAll
    40 #include "SynTree/Statement.h"     // for CompoundStmt, ImplicitCtorDtorStmt
    41 #include "SynTree/Type.h"          // for Type, ArrayType, Type::Qualifiers
    42 #include "SynTree/Visitor.h"       // for acceptAll, maybeAccept
    43 #include "Tuples/Tuples.h"         // for maybeImpure
     33#include "SymTab/Autogen.h"            // for genImplicitCall
     34#include "SymTab/Mangler.h"            // for Mangler
     35#include "SynTree/Declaration.h"       // for ObjectDecl, DeclarationWithType
     36#include "SynTree/Expression.h"        // for VariableExpr, UntypedExpr, Address...
     37#include "SynTree/Initializer.h"       // for ConstructorInit, SingleInit, Initi...
     38#include "SynTree/Label.h"             // for Label
     39#include "SynTree/Mutator.h"           // for mutateAll
     40#include "SynTree/Statement.h"         // for CompoundStmt, ImplicitCtorDtorStmt
     41#include "SynTree/Type.h"              // for Type, ArrayType, Type::Qualifiers
     42#include "SynTree/Visitor.h"           // for acceptAll, maybeAccept
     43#include "Tuples/Tuples.h"             // for maybeImpure
     44#include "Validate/FindSpecialDecls.h" // for SizeType
    4445
    4546namespace InitTweak {
     
    186187
    187188                        // need to resolve array dimensions in order to accurately determine if constexpr
    188                         ResolvExpr::findSingleExpression( arrayType->dimension, SymTab::SizeType->clone(), indexer );
     189                        ResolvExpr::findSingleExpression( arrayType->dimension, Validate::SizeType->clone(), indexer );
    189190                        // array is variable-length when the dimension is not constexpr
    190191                        arrayType->isVarLen = ! isConstExpr( arrayType->dimension );
     
    192193                        if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return;
    193194
    194                         ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
     195                        ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, Validate::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
    195196                        arrayDimension->get_type()->set_const( true );
    196197
Note: See TracChangeset for help on using the changeset viewer.