Changeset db0b3ce for src/GenPoly/Box.cc
- Timestamp:
- Dec 14, 2015, 4:28:46 PM (9 years ago)
- 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, string, with_gc
- Children:
- 5e92fee
- Parents:
- 56fcd77
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r56fcd77 rdb0b3ce 309 309 Type *concrete = env->lookup( tyParm->first ); 310 310 if ( concrete ) { 311 // TODO add alignment312 311 arg = appExpr->get_args().insert( arg, new SizeofExpr( concrete->clone() ) ); 312 arg++; 313 arg = appExpr->get_args().insert( arg, new AlignofExpr( concrete->clone() ) ); 313 314 arg++; 314 315 } else { … … 1008 1009 std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin(); 1009 1010 std::list< DeclarationWithType *> inferredParams; 1010 // TODO add alignment1011 1011 ObjectDecl *newObj = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 ); 1012 1012 // ObjectDecl *newFunPtr = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ); 1013 1013 for ( std::list< TypeDecl *>::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) { 1014 ObjectDecl * thisParm;1015 // add all size parameters to parameter list1014 ObjectDecl *sizeParm, *alignParm; 1015 // add all size and alignment parameters to parameter list 1016 1016 if ( (*tyParm)->get_kind() == TypeDecl::Any ) { 1017 thisParm = newObj->clone(); 1018 thisParm->set_name( (*tyParm)->get_name() ); 1019 last = funcType->get_parameters().insert( last, thisParm ); 1017 sizeParm = newObj->clone(); 1018 sizeParm->set_name( std::string("_sizeof_") + (*tyParm)->get_name() ); 1019 last = funcType->get_parameters().insert( last, sizeParm ); 1020 ++last; 1021 alignParm = newObj->clone(); 1022 alignParm->set_name( std::string("_alignof_") + (*tyParm)->get_name() ); 1023 last = funcType->get_parameters().insert( last, alignParm ); 1020 1024 ++last; 1021 1025 }
Note: See TracChangeset
for help on using the changeset viewer.