Skip to content

Commit

Permalink
pr: Add type constraints on operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Oct 22, 2024
1 parent 7be6225 commit 9859133
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions include/vast/Dialect/Parser/Ops.td
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,39 @@
include "mlir/IR/OpBase.td"

include "vast/Dialect/Core/Utils.td"
include "vast/Dialect/Parser/Types.td"

class Parser_Op< string mnemonic, list< Trait > traits = [] >
: Op< Parser_Dialect, mnemonic, traits >;

def Parser_Source
: Parser_Op< "source" >
, Arguments< (ins Variadic<AnyType>:$arguments) >
, Results< (outs Variadic<AnyType>:$result) >
, Results< (outs Variadic<Parser_DataType>:$result) >
{
let summary = "Source of parsed data.";
}

def Paser_Sink
: Parser_Op< "sink" >
, Arguments< (ins Variadic<AnyType>:$arguments) >
, Results< (outs Variadic<AnyType>:$result) >
, Arguments< (ins Variadic<Parser_MaybeDataType>:$arguments) >
, Results< (outs Variadic<Parser_NoDataType>:$result) >
{
let summary = "Sink of parsed data.";
}

def Parser_Parse
: Parser_Op< "parse" >
, Arguments< (ins Variadic<AnyType>:$arguments) >
, Arguments< (ins Variadic<Parser_MaybeDataType>:$arguments) >
, Results< (outs Variadic<AnyType>:$result) >
{
let summary = "Parsing operation data.";
}

def Parse_NoParse
: Parser_Op< "noparse" >
, Arguments< (ins Variadic<AnyType>:$arguments) >
, Results< (outs Variadic<AnyType>:$result) >
, Arguments< (ins Variadic<Parser_NoDataType>:$arguments) >
, Results< (outs Variadic<Parser_NoDataType>:$result) >
{
let summary = "Non-parsing operation data.";
}
Expand Down
2 changes: 1 addition & 1 deletion lib/vast/Dialect/Parser/Ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ VAST_UNRELAX_WARNINGS

#include "vast/Dialect/Parser/Dialect.hpp"
#include "vast/Dialect/Parser/Ops.hpp"
#include "vast/Dialect/HighLevel/HighLevelTypes.hpp"
#include "vast/Dialect/Parser/Types.hpp"

using namespace vast::pr;

Expand Down

0 comments on commit 9859133

Please sign in to comment.