summaryrefslogtreecommitdiff
path: root/utils/TableGen/Record.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-04 04:50:57 +0000
committerChris Lattner <sabre@nondot.org>2003-08-04 04:50:57 +0000
commit40f71134b9fef0ca06c516f033cc9403394a913c (patch)
tree1fb65d1311706e34922d3f7e676129634ad3097b /utils/TableGen/Record.h
parent5e2cb8b991cac2bbe38e275947f095dc8682dfc8 (diff)
downloadllvm-40f71134b9fef0ca06c516f033cc9403394a913c.tar.gz
llvm-40f71134b9fef0ca06c516f033cc9403394a913c.tar.bz2
llvm-40f71134b9fef0ca06c516f033cc9403394a913c.tar.xz
Add initial support for a new 'dag' type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.h')
-rw-r--r--utils/TableGen/Record.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h
index f933d4ff52..4573af0ee7 100644
--- a/utils/TableGen/Record.h
+++ b/utils/TableGen/Record.h
@@ -21,6 +21,7 @@ class IntRecTy;
class StringRecTy;
class ListRecTy;
class CodeRecTy;
+class DagRecTy;
class RecordRecTy;
// Init subclasses...
@@ -82,6 +83,7 @@ public: // These methods should only be called by subclasses of RecTy.
virtual bool baseClassOf(const StringRecTy *RHS) const { return false; }
virtual bool baseClassOf(const ListRecTy *RHS) const { return false; }
virtual bool baseClassOf(const CodeRecTy *RHS) const { return false; }
+ virtual bool baseClassOf(const DagRecTy *RHS) const { return false; }
virtual bool baseClassOf(const RecordRecTy *RHS) const { return false; }
};
@@ -214,6 +216,21 @@ struct CodeRecTy : public RecTy {
virtual bool baseClassOf(const CodeRecTy *RHS) const { return true; }
};
+/// DagRecTy - 'dag' - Represent a dag fragment
+///
+struct DagRecTy : public RecTy {
+ Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
+ //Init *convertValue( DagInit *CI) { return (Init*)CI; }
+ Init *convertValue(TypedInit *TI);
+
+ void print(std::ostream &OS) const { OS << "dag"; }
+
+ bool typeIsConvertibleTo(const RecTy *RHS) const {
+ return RHS->baseClassOf(this);
+ }
+ virtual bool baseClassOf(const DagRecTy *RHS) const { return true; }
+};
+
/// RecordRecTy - '<classname>' - Represent an instance of a class, such as:
/// (R32 X = EAX).