Changeset 2bfc6b2 for src/InitTweak/GenInit.cc
- Timestamp:
- Aug 30, 2018, 1:00:41 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- bcc0946
- Parents:
- a715b5c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/GenInit.cc
ra715b5c r2bfc6b2 15 15 #include "GenInit.h" 16 16 17 #include <stddef.h> // for NULL18 #include <algorithm> // for any_of19 #include <cassert> // for assert, strict_dynamic_cast, assertf20 #include <iterator> // for back_inserter, inserter, back_inse...21 #include <list> // for _List_iterator, list17 #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 22 22 23 23 #include "CodeGen/OperatorTable.h" 24 #include "Common/PassVisitor.h" // for PassVisitor, WithGuards, WithShort...25 #include "Common/SemanticError.h" // for SemanticError26 #include "Common/UniqueName.h" // for UniqueName27 #include "Common/utility.h" // for ValueGuard, maybeClone28 #include "GenPoly/GenPoly.h" // for getFunctionType, isPolyType29 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::const_iter...30 #include "InitTweak.h" // for isConstExpr, InitExpander, checkIn...31 #include "Parser/LinkageSpec.h" // for isOverridable, C24 #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 32 32 #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 44 45 45 46 namespace InitTweak { … … 186 187 187 188 // 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 ); 189 190 // array is variable-length when the dimension is not constexpr 190 191 arrayType->isVarLen = ! isConstExpr( arrayType->dimension ); … … 192 193 if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return; 193 194 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() ) ); 195 196 arrayDimension->get_type()->set_const( true ); 196 197
Note: See TracChangeset
for help on using the changeset viewer.