Files
llvm/mlir/lib/Tools/PDLL/AST/Context.cpp
River Riddle 11d26bd143 [mlir][PDLL] Add an initial frontend for PDLL
This is a new pattern rewrite frontend designed from the ground
up to support MLIR constructs, and to target PDL. This frontend
language was proposed in https://llvm.discourse.group/t/rfc-pdll-a-new-declarative-rewrite-frontend-for-mlir/4798

This commit starts sketching out the base structure of the
frontend, and is intended to be a minimal starting point for
building up the language. It essentially contains support for
defining a pattern, variables, and erasing an operation. The
features mentioned in the proposal RFC (including IDE support)
will be added incrementally in followup commits.

I intend to upstream the documentation for the language in a
followup when a bit more of the pieces have been landed.

Differential Revision: https://reviews.llvm.org/D115093
2021-12-16 02:08:12 +00:00

24 lines
962 B
C++

//===- Context.cpp --------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "mlir/Tools/PDLL/AST/Context.h"
#include "TypeDetail.h"
using namespace mlir;
using namespace mlir::pdll::ast;
Context::Context() {
typeUniquer.registerSingletonStorageType<detail::AttributeTypeStorage>();
typeUniquer.registerSingletonStorageType<detail::ConstraintTypeStorage>();
typeUniquer.registerSingletonStorageType<detail::TypeTypeStorage>();
typeUniquer.registerSingletonStorageType<detail::ValueTypeStorage>();
typeUniquer.registerParametricStorageType<detail::OperationTypeStorage>();
typeUniquer.registerParametricStorageType<detail::RangeTypeStorage>();
}