LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fragment.hxx
Go to the documentation of this file.
1 
6 #ifndef ASSEM_FRAGMENT_HXX
7 # define ASSEM_FRAGMENT_HXX
8 
9 # include <misc/contract.hh>
10 
11 # include <assem/fragment.hh>
12 
13 namespace assem
14 {
15 
16  /*-----------.
17  | Fragment. |
18  `-----------*/
19 
20  inline
22  {}
23 
24  inline std::ostream&
25  operator<<(std::ostream& ostr,
26  const Fragment& fragment)
27  {
28  return fragment.dump(ostr);
29  }
30 
31 
32  /*-----------.
33  | DataFrag. |
34  `-----------*/
35 
36  inline
38  : data_frag_(frag)
39  {}
40 
41  inline const tree::DataFrag&
43  {
44  return data_frag_;
45  }
46 
47 
48  /*-----------.
49  | ProcFrag. |
50  `-----------*/
51 
52  inline
54  : frame_(frag.frame_get())
55  , name_(frag.name_get())
56  , label_(frag.label_get())
57  {}
58 
59  inline frame::Frame&
61  {
62  return frame_;
63  }
64 
65  inline const misc::symbol&
67  {
68  return name_;
69  }
70 
71  inline temp::Label
73  {
74  return label_;
75  }
76 
77  inline void
79  {
80  precondition(instrs_.empty());
81  std::swap(instrs_, instrs);
82  }
83 
84  inline assem::Instrs&
86  {
87  return instrs_;
88  }
89 
90  inline const assem::Instrs&
92  {
93  return instrs_;
94  }
95 
96 } // namespace assem
97 
98 #endif // !ASSEM_FRAGMENT_HXX