Skip to content

Commit

Permalink
conv:tc: Replace redefinitions from parent class with using.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Nov 9, 2023
1 parent 5f7ecc8 commit 64ceaca
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions include/vast/Conversion/TypeConverters/HLToStd.hpp
Original file line number Diff line number Diff line change
@@ -110,6 +110,10 @@ namespace vast::conv::tc {
, mixins< HLToStd >
, HLAggregates< HLToStd >
{
using Base = mixins< HLToStd >;
using Base::convert_type_to_type;
using Base::convert_type_to_types;

const mlir::DataLayout &dl;
mlir::MLIRContext &mctx;

@@ -185,20 +189,6 @@ namespace vast::conv::tc {
};
}

maybe_types_t convert_type_to_types(mlir_type t, std::size_t count = 1) {
return Maybe(t)
.and_then(convert_type())
.keep_if([&](const auto &ts) { return ts->size() == count; })
.take_wrapped< maybe_types_t >();
}

maybe_type_t convert_type_to_type(mlir_type t) {
return Maybe(t)
.and_then([&](auto t) { return this->convert_type_to_types(t, 1); })
.and_then([&](auto ts) { return *ts->begin(); })
.take_wrapped< maybe_type_t >();
}

maybe_type_t try_convert_intlike(mlir_type t) {
// For now `bool` behaves the same way as any other integer type.
if (!hl::isIntegerType(t) && !hl::isBoolType(t)) {

0 comments on commit 64ceaca

Please sign in to comment.