1 #ifndef NOM_REPRESENTATIONS_COMPILER_H 2 #define NOM_REPRESENTATIONS_COMPILER_H 4 #include "nomnigraph/Graph/Graph.h" 5 #include "nomnigraph/Support/Casting.h" 13 Value(ValueKind K) : Kind(K) {}
14 Value() : Kind(ValueKind::Value) {}
15 ValueKind getKind()
const {
return Kind; }
16 virtual ~
Value() =
default;
25 static bool classof(
const Value *V) {
26 return V->getKind() == ValueKind::Data;
28 virtual ~
Data() =
default;
29 size_t getVersion()
const {
return Version; }
31 void setVersion(
size_t version) { Version = version; }
50 static bool classof(
const Value *V) {
51 return V->getKind() == ValueKind::Instruction;
54 Opcode getOpcode()
const {
return Op; }
65 static bool classof(
const Value *V) {
66 return isa<Instruction>(V) &&
67 isTerminator(cast<Instruction>(V)->getOpcode());
69 static bool isTerminator(
const Opcode &op) {
70 return op >= Opcode::TerminatorStart && op <= Opcode::TerminatorEnd;
92 #endif // NOM_REPRESENTATIONS_COMPILER_H
Opcode
All the different types of execution.