Skip to content

Commit

Permalink
conv: Remove obsolete lvalue type conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Sep 17, 2024
1 parent 403cde9 commit cb17a91
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/vast/Conversion/Generic/LowerValueCategories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace vast::conv {
// Do we need data layout? Probably not as everything should be explicit
// type size wise.
value_category_type_converter(mcontext_t &mctx) : mctx(mctx) {
addConversion([&](mlir_type t) { return t; });
addConversion([&](hl::LValueType type) {
// It should never happen that we have nested lvalues?
auto element_type = this->convert_type_to_type(type.getElementType());
Expand Down Expand Up @@ -70,21 +69,6 @@ namespace vast::conv {
using mixin_base = tc::mixins< value_category_type_converter >;
using mixin_base::convert_type_to_type;
using mixin_base::convert_type_to_types;

template< typename T, typename... Args >
auto make_aggregate_type(Args... args) {
return [=](mlir_type elem) { return T::get(elem.getContext(), elem, args...); };
}

auto convert_lvalue_type() {
return [&](hl::LValueType type) {
return Maybe(type.getElementType())
.and_then(convert_type_to_type())
.unwrap()
.and_then(make_aggregate_type< hl::PointerType >())
.template take_wrapped< maybe_type_t >();
};
}
};

#define VAST_DEFINE_REWRITE \
Expand Down

0 comments on commit cb17a91

Please sign in to comment.