Skip to content

Commit

Permalink
pr: Setup noparse folding.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Nov 7, 2024
1 parent 31c8f14 commit 3faafc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 2 additions & 0 deletions include/vast/Dialect/Parser/Ops.td
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def Parse_NoParse
{
let summary = "Non-parsing operation data.";

let hasFolder = 1;

let assemblyFormat = [{
$arguments attr-dict `:` functional-type($arguments, $result)
}];
Expand Down
27 changes: 12 additions & 15 deletions lib/vast/Dialect/Parser/Ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@

#include "vast/Util/Warnings.hpp"

VAST_RELAX_WARNINGS
#include <mlir/IR/Builders.h>
#include <mlir/IR/OpImplementation.h>
#include <mlir/IR/OperationSupport.h>
#include <mlir/IR/SymbolTable.h>

#include <mlir/Interfaces/FunctionImplementation.h>
#include <mlir/Interfaces/CallInterfaces.h>

#include <mlir/Support/LLVM.h>
#include <mlir/Support/LogicalResult.h>

#include <llvm/Support/ErrorHandling.h>
VAST_UNRELAX_WARNINGS

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

#include "vast/Util/Common.hpp"

using namespace vast::pr;

#define GET_OP_CLASSES
#include "vast/Dialect/Parser/Parser.cpp.inc"

namespace vast::pr {

using fold_result_t = ::llvm::SmallVectorImpl< ::mlir::OpFoldResult >;

logical_result NoParse::fold(FoldAdaptor adaptor, fold_result_t &results) {
return mlir::failure();
}

} // namespace vast::pr

0 comments on commit 3faafc2

Please sign in to comment.