@@ -40,7 +40,7 @@ void DwarfExpression::emitConstu(uint64_t Value) {
4040
4141void DwarfExpression::addReg (int DwarfReg, const char *Comment) {
4242 assert (DwarfReg >= 0 && " invalid negative dwarf register number" );
43- assert ((LocationKind == Unknown || LocationKind == Register ) &&
43+ assert ((isUnknownLocation () || isRegisterLocation () ) &&
4444 " location description already locked down" );
4545 LocationKind = Register;
4646 if (DwarfReg < 32 ) {
@@ -53,7 +53,7 @@ void DwarfExpression::addReg(int DwarfReg, const char *Comment) {
5353
5454void DwarfExpression::addBReg (int DwarfReg, int Offset) {
5555 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" );
5757 if (DwarfReg < 32 ) {
5858 emitOp (dwarf::DW_OP_breg0 + DwarfReg);
5959 } else {
@@ -184,20 +184,20 @@ void DwarfExpression::addStackValue() {
184184}
185185
186186void DwarfExpression::addSignedConstant (int64_t Value) {
187- assert (LocationKind == Implicit || LocationKind == Unknown );
187+ assert (isImplicitLocation () || isUnknownLocation () );
188188 LocationKind = Implicit;
189189 emitOp (dwarf::DW_OP_consts);
190190 emitSigned (Value);
191191}
192192
193193void DwarfExpression::addUnsignedConstant (uint64_t Value) {
194- assert (LocationKind == Implicit || LocationKind == Unknown );
194+ assert (isImplicitLocation () || isUnknownLocation () );
195195 LocationKind = Implicit;
196196 emitConstu (Value);
197197}
198198
199199void DwarfExpression::addUnsignedConstant (const APInt &Value) {
200- assert (LocationKind == Implicit || LocationKind == Unknown );
200+ assert (isImplicitLocation () || isUnknownLocation () );
201201 LocationKind = Implicit;
202202
203203 unsigned Size = Value.getBitWidth ();
@@ -242,7 +242,7 @@ bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI,
242242 }
243243
244244 // Handle simple register locations.
245- if (LocationKind != Memory && !HasComplexExpression) {
245+ if (! isMemoryLocation () && !HasComplexExpression) {
246246 for (auto &Reg : DwarfRegs) {
247247 if (Reg.DwarfRegNo >= 0 )
248248 addReg (Reg.DwarfRegNo , Reg.Comment );
@@ -343,7 +343,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
343343 SizeInBits = std::min<unsigned >(SizeInBits, SubRegisterSizeInBits);
344344
345345 // Emit a DW_OP_stack_value for implicit location descriptions.
346- if (LocationKind == Implicit )
346+ if (isImplicitLocation () )
347347 addStackValue ();
348348
349349 // Emit the DW_OP_piece.
@@ -354,7 +354,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
354354 return ;
355355 }
356356 case dwarf::DW_OP_plus_uconst:
357- assert (LocationKind != Register );
357+ assert (! isRegisterLocation () );
358358 emitOp (dwarf::DW_OP_plus_uconst);
359359 emitUnsigned (Op->getArg (0 ));
360360 break ;
@@ -375,16 +375,16 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
375375 emitOp (Op->getOp ());
376376 break ;
377377 case dwarf::DW_OP_deref:
378- assert (LocationKind != Register );
379- if (LocationKind != Memory && ::isMemoryLocation (ExprCursor))
378+ assert (! isRegisterLocation () );
379+ if (! isMemoryLocation () && ::isMemoryLocation (ExprCursor))
380380 // Turning this into a memory location description makes the deref
381381 // implicit.
382382 LocationKind = Memory;
383383 else
384384 emitOp (dwarf::DW_OP_deref);
385385 break ;
386386 case dwarf::DW_OP_constu:
387- assert (LocationKind != Register );
387+ assert (! isRegisterLocation () );
388388 emitConstu (Op->getArg (0 ));
389389 break ;
390390 case dwarf::DW_OP_LLVM_convert: {
@@ -427,11 +427,11 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
427427 LocationKind = Implicit;
428428 break ;
429429 case dwarf::DW_OP_swap:
430- assert (LocationKind != Register );
430+ assert (! isRegisterLocation () );
431431 emitOp (dwarf::DW_OP_swap);
432432 break ;
433433 case dwarf::DW_OP_xderef:
434- assert (LocationKind != Register );
434+ assert (! isRegisterLocation () );
435435 emitOp (dwarf::DW_OP_xderef);
436436 break ;
437437 case dwarf::DW_OP_deref_size:
@@ -443,7 +443,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
443443 }
444444 }
445445
446- if (LocationKind == Implicit )
446+ if (isImplicitLocation () )
447447 // Turn this into an implicit location description.
448448 addStackValue ();
449449}
0 commit comments