From ab8a3f6d4df3b126bb6874449c4be662adbd7594 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 11 Jun 2019 19:04:06 +0900 Subject: [PATCH] [loco] Extend Node with dialect method (#3730) This commit extends Node with dialect method as a step toward multi-dialect support. Signed-off-by: Jonghyun Park --- contrib/loco/include/loco/IR/Node.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/loco/include/loco/IR/Node.h b/contrib/loco/include/loco/IR/Node.h index a43af42..0dc809b 100644 --- a/contrib/loco/include/loco/IR/Node.h +++ b/contrib/loco/include/loco/IR/Node.h @@ -20,6 +20,7 @@ #include "loco/ADT/AnnotatedItem.h" #include "loco/IR/Use.h" +#include "loco/IR/Dialect.h" #include #include @@ -62,6 +63,14 @@ public: virtual ~Node() = default; public: + /** + * @brief Return "Dialect" identifier that this node belongs to + * + * dialect() returns nullptr if there is no corresponding dialect. + */ + virtual Dialect *dialect(void) const { return nullptr; } + +public: /// @brief Return the number of arguments virtual uint32_t arity(void) const = 0; -- 2.7.4