Skip to content

Commit

Permalink
conv: Remove now obsolete lvalue function type conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Sep 18, 2024
1 parent c7bf438 commit 0fd639d
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions lib/vast/Conversion/Generic/LowerValueCategories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace vast::conv {
struct value_category_type_converter
: tc::identity_type_converter
, tc::mixins< value_category_type_converter >
, tc::function_type_converter< value_category_type_converter >
{
mlir::MLIRContext &mctx;

Expand Down Expand Up @@ -463,10 +462,11 @@ namespace vast::conv {

patterns.add< fallback >(tc, mctx);
patterns.add< store_and_forward_ptr< ll::CellInit > >(mctx, tc);
patterns
.add< ignore< hl::DeclRefOp >, ignore< hl::Deref >, ignore< hl::AddressOf > >(
mctx, tc
);
patterns.add<
ignore< hl::DeclRefOp >,
ignore< hl::Deref >,
ignore< hl::AddressOf >
>(mctx, tc);

patterns.add< memory_allocation< ll::Cell > >(mctx, tc);
patterns.add< subscript >(mctx, tc);
Expand Down Expand Up @@ -506,22 +506,10 @@ namespace vast::conv {
// This will never have correct types but we want to have it legal.
trg.addLegalOp< mlir::UnrealizedConversionCastOp >();

convert_function_types(tc);
if (mlir::failed(mlir::applyPartialConversion(root, trg, std::move(patterns)))) {
return signalPassFailure();
}
}

void convert_function_types(value_category_type_converter &tc) {
auto root = getOperation();
auto pattern = fn< ll::FuncOp >(getContext(), tc);
auto walker = [&](mlir::FunctionOpInterface op) {
type_rewriter bld(&getContext());
[[maybe_unused]] auto status = pattern.replace(op, bld);
};

root->walk(walker);
}
};
} // namespace vast::conv

Expand Down

0 comments on commit 0fd639d

Please sign in to comment.