Skip to content

Commit 3b5413c

Browse files
committed
[CodeGen] Use MCRegister in DbgVariableLocation. NFC
1 parent 6c66cda commit 3b5413c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/include/llvm/CodeGen/DebugHandlerBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MachineModuleInfo;
3030
/// Represents the location at which a variable is stored.
3131
struct DbgVariableLocation {
3232
/// Base register.
33-
unsigned Register;
33+
MCRegister Register;
3434

3535
/// Chain of offsetted loads necessary to load the value if it lives in
3636
/// memory. Every load except for the last is pointer-sized.

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ void CodeViewDebug::calculateRanges(
13611361
}
13621362

13631363
// We can only handle a register or an offseted load of a register.
1364-
if (Location->Register == 0 || Location->LoadChain.size() > 1)
1364+
if (!Location->Register || Location->LoadChain.size() > 1)
13651365
continue;
13661366

13671367
// Codeview can only express byte-aligned offsets, ensure that we have a

llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DbgVariableLocation::extractFromMachineInstruction(
3939
return std::nullopt;
4040
if (!Instruction.getDebugOperand(0).isReg())
4141
return std::nullopt;
42-
Location.Register = Instruction.getDebugOperand(0).getReg();
42+
Location.Register = Instruction.getDebugOperand(0).getReg().asMCReg();
4343
Location.FragmentInfo.reset();
4444
// We only handle expressions generated by DIExpression::appendOffset,
4545
// which doesn't require a full stack machine.

0 commit comments

Comments
 (0)