LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
move.hxx
Go to the documentation of this file.
1 
6 #ifndef ASSEM_MOVE_HXX
7 # define ASSEM_MOVE_HXX
8 
9 # include <misc/contract.hh>
10 # include <assem/move.hh>
11 
12 namespace assem
13 {
15 
16  inline
17  Move::Move(const std::string& assem,
18  const temp::Temp& used_temps,
19  const temp::Temp& defd_temps)
20  : Instr(assem, L(used_temps), L(defd_temps))
21  {
22  }
23 
24  inline temp::Temp
25  Move::dst_get() const
26  {
27  return def().front();
28  }
29 
30  inline temp::Temp
31  Move::src_get() const
32  {
33  return use().front();
34  }
35 
36  inline temp::Temp
37  Move::use_get() const
38  {
39  precondition(use_.size() == 1);
40  return use_.front();
41  }
42 
43  inline temp::Temp
44  Move::def_get() const
45  {
46  precondition(def_.size() == 1);
47  return def_.front();
48  }
49 
50  inline std::ostream&
51  Move::dump(std::ostream& ostr) const
52  {
53  ostr << '\t';
54  return Instr::dump(ostr);
55  }
56 
57 } // namespace assem
58 
59 #endif // !ASSEM_MOVE_HXX