diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-01-15 17:35:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-15 17:35:43 -0500 |
| commit | 8d40f659fabdba2d6a17228f76168e7bdbf5c955 (patch) | |
| tree | 7e12f32a9e034bb5977bb565ed247903883e7aa7 /willow/lib/IR/Instruction.cpp | |
| parent | 33be313727e350845d6dc11b8f4871f926ae90c2 (diff) | |
| download | compiler-8d40f659fabdba2d6a17228f76168e7bdbf5c955.tar.gz | |
[willow]: iron out design (#6)
Diffstat (limited to 'willow/lib/IR/Instruction.cpp')
| -rw-r--r-- | willow/lib/IR/Instruction.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/willow/lib/IR/Instruction.cpp b/willow/lib/IR/Instruction.cpp index a61cd55..587736d 100644 --- a/willow/lib/IR/Instruction.cpp +++ b/willow/lib/IR/Instruction.cpp @@ -1,3 +1,38 @@ #include <willow/IR/Instruction.h> -namespace willow {}; +namespace willow { + +bool Instruction::isTerminatorOp(Opcode op) { + using enum Opcode; + switch (op) { + case Jmp: + case Br: + case Call: + case Ret: + return true; + case Add: + case Mul: + case Sub: + case Div: + case Mod: + case Shl: + case Shr: + case Ashl: + case Ashr: + case Eq: + case Lt: + case Gt: + case Le: + case Ge: + case And: + case Or: + case Not: + case Phi: + case Alloca: + return false; + } +} + +Successors Instruction::succs(); + +}; // namespace willow |