Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser type conversions #750

Merged
merged 24 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
58a1293
conv: Add unrealized conversion materialization helper.
xlauko Nov 19, 2024
b3999ee
core: Add arithmetic binary op interface.
xlauko Nov 20, 2024
2424432
hl: Annotate arithmetic operations with core trait.
xlauko Nov 20, 2024
95561f7
pr: Reconcile unrealized casts on the fly.
xlauko Nov 20, 2024
ad64dcb
pr: Let parser detector invoke standard conversions.
xlauko Nov 20, 2024
8d8a930
pr: Fix MaybeDataType predicate to include NoDataType.
xlauko Nov 20, 2024
d67a714
pr: Fix fclose model to expect nodata.
xlauko Nov 20, 2024
f388241
pr: Swap AnyDataType and MaybeDataType.
xlauko Nov 20, 2024
4e4b55f
pr: Resurrect type constraints.
xlauko Nov 20, 2024
d770373
pr: Add to_maybe cast.
xlauko Nov 20, 2024
5171843
conv: Make function signature conversion allow to reflect on index of…
xlauko Nov 22, 2024
b512ade
conv: Add parser function conversion.
xlauko Nov 22, 2024
d4556e5
pr: Add model for main function.
xlauko Nov 22, 2024
c165958
pr: Add parser decl.
xlauko Nov 22, 2024
06017f6
conv: Add param to parser decl conversion.
xlauko Nov 22, 2024
934fad2
pr: Add reference operation.
xlauko Nov 22, 2024
f42479c
hl: Fix scope annotations.
xlauko Nov 22, 2024
cfe9b0d
conv: Introduce decl ref converion to parser ref.
xlauko Nov 22, 2024
2bda66a
pr: Fix include.
xlauko Nov 22, 2024
df8f2b2
pr: Fix types for decl ref conversion.
xlauko Nov 22, 2024
c41da62
conv: Add return conversion pattern.
xlauko Nov 22, 2024
8f44b39
conv: Add non-parsing cmp conversion.
xlauko Nov 22, 2024
0b52fcd
conv: Simplify unrealized_materialization.
xlauko Nov 25, 2024
6f04dc7
tools: Remove obsolete detect-parsers.
xlauko Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
conv: Add param to parser decl conversion.
  • Loading branch information
xlauko committed Nov 25, 2024
commit 06017f61fac1b50a7eb4dc9225a0012c96c4cd4f
21 changes: 21 additions & 0 deletions lib/vast/Conversion/Parser/ToParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,26 @@ namespace vast::conv {
}
};

struct ParamConversion
: one_to_one_conversion_pattern< hl::ParmVarDeclOp, pr::Decl >
{
using op_t = hl::ParmVarDeclOp;
using base = one_to_one_conversion_pattern< hl::ParmVarDeclOp, pr::Decl >;
using base::base;

using adaptor_t = typename op_t::Adaptor;

logical_result matchAndRewrite(
op_t op, adaptor_t adaptor, conversion_rewriter &rewriter
) const override {
rewriter.replaceOpWithNewOp< pr::Decl >(
op, op.getSymName(), op.getParam().getType()
);

return mlir::success();
}
};

struct FuncConversion
: parser_conversion_pattern_base< hl::FuncOp >
, tc::op_type_conversion< hl::FuncOp, function_type_converter >
Expand Down Expand Up @@ -397,6 +417,7 @@ namespace vast::conv {
ToNoParse< hl::ConstantOp >,
ToNoParse< hl::ImplicitCastOp >,
FuncConversion,
ParamConversion,
CallConversion
>;

Expand Down