@@ -101,20 +101,18 @@ class TargetRegisterInfo;
101
101
SDep () : Dep(nullptr , Data) {}
102
102
103
103
// / Constructs an SDep with the specified values.
104
- SDep (SUnit *S, Kind kind, unsigned Reg)
105
- : Dep(S, kind), Contents() {
104
+ SDep (SUnit *S, Kind kind, Register Reg) : Dep(S, kind), Contents() {
106
105
switch (kind) {
107
106
default :
108
107
llvm_unreachable (" Reg given for non-register dependence!" );
109
108
case Anti:
110
109
case Output:
111
- assert (Reg != 0 &&
112
- " SDep::Anti and SDep::Output must use a non-zero Reg!" );
113
- Contents.Reg = Reg;
110
+ assert (Reg && " SDep::Anti and SDep::Output must use a non-zero Reg!" );
111
+ Contents.Reg = Reg.id ();
114
112
Latency = 0 ;
115
113
break ;
116
114
case Data:
117
- Contents.Reg = Reg;
115
+ Contents.Reg = Reg. id () ;
118
116
Latency = 1 ;
119
117
break ;
120
118
}
@@ -208,14 +206,12 @@ class TargetRegisterInfo;
208
206
}
209
207
210
208
// / Tests if this is a Data dependence that is associated with a register.
211
- bool isAssignedRegDep () const {
212
- return getKind () == Data && Contents.Reg != 0 ;
213
- }
209
+ bool isAssignedRegDep () const { return getKind () == Data && Contents.Reg ; }
214
210
215
211
// / Returns the register associated with this edge. This is only valid on
216
212
// / Data, Anti, and Output edges. On Data edges, this value may be zero,
217
213
// / meaning there is no associated register.
218
- unsigned getReg () const {
214
+ Register getReg () const {
219
215
assert ((getKind () == Data || getKind () == Anti || getKind () == Output) &&
220
216
" getReg called on non-register dependence edge!" );
221
217
return Contents.Reg ;
@@ -225,14 +221,14 @@ class TargetRegisterInfo;
225
221
// / Data, Anti, and Output edges. On Anti and Output edges, this value must
226
222
// / not be zero. On Data edges, the value may be zero, which would mean that
227
223
// / no specific register is associated with this edge.
228
- void setReg (unsigned Reg) {
224
+ void setReg (Register Reg) {
229
225
assert ((getKind () == Data || getKind () == Anti || getKind () == Output) &&
230
226
" setReg called on non-register dependence edge!" );
231
- assert ((getKind () != Anti || Reg != 0 ) &&
227
+ assert ((getKind () != Anti || Reg) &&
232
228
" SDep::Anti edge cannot use the zero register!" );
233
- assert ((getKind () != Output || Reg != 0 ) &&
229
+ assert ((getKind () != Output || Reg) &&
234
230
" SDep::Output edge cannot use the zero register!" );
235
- Contents.Reg = Reg;
231
+ Contents.Reg = Reg. id () ;
236
232
}
237
233
238
234
void dump (const TargetRegisterInfo *TRI = nullptr ) const ;
0 commit comments