simple constexpr

This commit is contained in:
Philippe Tillet
2019-08-05 13:06:56 -07:00
parent d869d9a924
commit 899b2b72e1
9 changed files with 96 additions and 21 deletions

View File

@@ -79,7 +79,8 @@ ir::type* tile::type_impl(ir::module *mod, ir::type *type, storage_spec_vec_cons
ir::type::tile_shapes_t shapes;
for(expression *expr: shapes_->values()){
ir::constant_int *shape = dynamic_cast<ir::constant_int*>(expr->codegen(mod));
assert(shape);
if(shape == nullptr)
throw std::runtime_error("tile shapes must be constant expressions");
shapes.push_back(shape);
}
return ir::tile_type::get(type, shapes);