[intermediate representation] added some builder function definitions

This commit is contained in:
Philippe Tillet
2019-01-03 12:44:33 -05:00
parent 8f4aafb4ac
commit 9a1739957d
6 changed files with 98 additions and 30 deletions

View File

@@ -152,5 +152,20 @@ tile_type* tile_type::get_same_shapes(type *ty, type *ref){
}
//===----------------------------------------------------------------------===//
// function_type class
//===----------------------------------------------------------------------===//
function_type::function_type(type *ret_ty, const std::vector<type*> &param_tys):
type(ret_ty->get_context(), FunctionTyID) {
contained_tys_.push_back(ret_ty);
for(type *ty: param_tys)
contained_tys_.push_back(ty);
}
function_type* function_type::get(type *ret_ty, const std::vector<type *> &param_tys) {
return new function_type(ret_ty, param_tys);
}
}
}