llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
mov.h
1 // This file if part of the llir-opt project.
2 // Licensing information can be found in the LICENSE file.
3 // (C) 2018 Nandor Licker. All rights reserved.
4 
5 #pragma once
6 
7 #include <optional>
8 
9 #include <llvm/ADT/iterator.h>
10 
11 #include "core/inst.h"
12 
13 
17 class MovInst final : public OperatorInst {
18 public:
20  static constexpr Inst::Kind kInstKind = Inst::Kind::MOV;
21 
22 public:
23  MovInst(Type type, Ref<Value> op, AnnotSet &&annot);
24  MovInst(Type type, Ref<Value> op, const AnnotSet &annot);
25 
26  ~MovInst();
27 
29  ConstRef<Value> GetArg() const;
32 
34  bool IsConstant() const override { return !GetArg()->Is(Value::Kind::INST); }
35 };
Inst::Kind
Kind
Definition: inst.h:65
MovInst::kInstKind
static constexpr Inst::Kind kInstKind
Kind of the instruction.
Definition: mov.h:20
ConstRef
Definition: ref.h:83
MovInst::IsConstant
bool IsConstant() const override
Instruction is constant if argument is.
Definition: mov.h:34
AnnotSet
Definition: annot.h:69
MovInst
Definition: mov.h:17
MovInst::GetArg
ConstRef< Value > GetArg() const
Returns the value read/moved.
Definition: mov.cpp:46
Ref< Value >