@@ -40,7 +40,7 @@ void DwarfExpression::emitConstu(uint64_t Value) {
40
40
41
41
void DwarfExpression::addReg (int DwarfReg, const char *Comment) {
42
42
assert (DwarfReg >= 0 && " invalid negative dwarf register number" );
43
- assert ((LocationKind == Unknown || LocationKind == Register ) &&
43
+ assert ((isUnknownLocation () || isRegisterLocation () ) &&
44
44
" location description already locked down" );
45
45
LocationKind = Register;
46
46
if (DwarfReg < 32 ) {
@@ -53,7 +53,7 @@ void DwarfExpression::addReg(int DwarfReg, const char *Comment) {
53
53
54
54
void DwarfExpression::addBReg (int DwarfReg, int Offset) {
55
55
assert (DwarfReg >= 0 && " invalid negative dwarf register number" );
56
- assert (LocationKind != Register && " location description already locked down" );
56
+ assert (! isRegisterLocation () && " location description already locked down" );
57
57
if (DwarfReg < 32 ) {
58
58
emitOp (dwarf::DW_OP_breg0 + DwarfReg);
59
59
} else {
@@ -184,20 +184,20 @@ void DwarfExpression::addStackValue() {
184
184
}
185
185
186
186
void DwarfExpression::addSignedConstant (int64_t Value) {
187
- assert (LocationKind == Implicit || LocationKind == Unknown );
187
+ assert (isImplicitLocation () || isUnknownLocation () );
188
188
LocationKind = Implicit;
189
189
emitOp (dwarf::DW_OP_consts);
190
190
emitSigned (Value);
191
191
}
192
192
193
193
void DwarfExpression::addUnsignedConstant (uint64_t Value) {
194
- assert (LocationKind == Implicit || LocationKind == Unknown );
194
+ assert (isImplicitLocation () || isUnknownLocation () );
195
195
LocationKind = Implicit;
196
196
emitConstu (Value);
197
197
}
198
198
199
199
void DwarfExpression::addUnsignedConstant (const APInt &Value) {
200
- assert (LocationKind == Implicit || LocationKind == Unknown );
200
+ assert (isImplicitLocation () || isUnknownLocation () );
201
201
LocationKind = Implicit;
202
202
203
203
unsigned Size = Value.getBitWidth ();
@@ -242,7 +242,7 @@ bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI,
242
242
}
243
243
244
244
// Handle simple register locations.
245
- if (LocationKind != Memory && !HasComplexExpression) {
245
+ if (! isMemoryLocation () && !HasComplexExpression) {
246
246
for (auto &Reg : DwarfRegs) {
247
247
if (Reg.DwarfRegNo >= 0 )
248
248
addReg (Reg.DwarfRegNo , Reg.Comment );
@@ -343,7 +343,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
343
343
SizeInBits = std::min<unsigned >(SizeInBits, SubRegisterSizeInBits);
344
344
345
345
// Emit a DW_OP_stack_value for implicit location descriptions.
346
- if (LocationKind == Implicit )
346
+ if (isImplicitLocation () )
347
347
addStackValue ();
348
348
349
349
// Emit the DW_OP_piece.
@@ -354,7 +354,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
354
354
return ;
355
355
}
356
356
case dwarf::DW_OP_plus_uconst:
357
- assert (LocationKind != Register );
357
+ assert (! isRegisterLocation () );
358
358
emitOp (dwarf::DW_OP_plus_uconst);
359
359
emitUnsigned (Op->getArg (0 ));
360
360
break ;
@@ -375,16 +375,16 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
375
375
emitOp (Op->getOp ());
376
376
break ;
377
377
case dwarf::DW_OP_deref:
378
- assert (LocationKind != Register );
379
- if (LocationKind != Memory && ::isMemoryLocation (ExprCursor))
378
+ assert (! isRegisterLocation () );
379
+ if (! isMemoryLocation () && ::isMemoryLocation (ExprCursor))
380
380
// Turning this into a memory location description makes the deref
381
381
// implicit.
382
382
LocationKind = Memory;
383
383
else
384
384
emitOp (dwarf::DW_OP_deref);
385
385
break ;
386
386
case dwarf::DW_OP_constu:
387
- assert (LocationKind != Register );
387
+ assert (! isRegisterLocation () );
388
388
emitConstu (Op->getArg (0 ));
389
389
break ;
390
390
case dwarf::DW_OP_LLVM_convert: {
@@ -427,11 +427,11 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
427
427
LocationKind = Implicit;
428
428
break ;
429
429
case dwarf::DW_OP_swap:
430
- assert (LocationKind != Register );
430
+ assert (! isRegisterLocation () );
431
431
emitOp (dwarf::DW_OP_swap);
432
432
break ;
433
433
case dwarf::DW_OP_xderef:
434
- assert (LocationKind != Register );
434
+ assert (! isRegisterLocation () );
435
435
emitOp (dwarf::DW_OP_xderef);
436
436
break ;
437
437
case dwarf::DW_OP_deref_size:
@@ -443,7 +443,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
443
443
}
444
444
}
445
445
446
- if (LocationKind == Implicit )
446
+ if (isImplicitLocation () )
447
447
// Turn this into an implicit location description.
448
448
addStackValue ();
449
449
}
0 commit comments