Skip to content

Commit f78a48c

Browse files
committed
[MC] Use std::optional<MCRegisters> for values returned by MCRegisterInfo::getLLVMRegNum. NFC
I missed a few places when I changed the function return type in f2b7149.
1 parent 947374c commit f78a48c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
681681
auto GetRegName = [&MCRegInfo](uint64_t DwarfRegNum, bool IsEH) -> StringRef {
682682
if (!MCRegInfo)
683683
return {};
684-
if (std::optional<unsigned> LLVMRegNum =
684+
if (std::optional<MCRegister> LLVMRegNum =
685685
MCRegInfo->getLLVMRegNum(DwarfRegNum, IsEH))
686686
if (const char *RegName = MCRegInfo->getName(*LLVMRegNum))
687687
return StringRef(RegName);

llvm/tools/llvm-objdump/SourcePrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void LiveVariable::print(raw_ostream &OS, const MCRegisterInfo &MRI) const {
4040
DWARFExpression Expression(Data, Unit->getAddressByteSize());
4141

4242
auto GetRegName = [&MRI, &OS](uint64_t DwarfRegNum, bool IsEH) -> StringRef {
43-
if (std::optional<unsigned> LLVMRegNum =
43+
if (std::optional<MCRegister> LLVMRegNum =
4444
MRI.getLLVMRegNum(DwarfRegNum, IsEH))
4545
if (const char *RegName = MRI.getName(*LLVMRegNum))
4646
return StringRef(RegName);

llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void DWARFExpressionCompactPrinterTest::TestExprPrinter(
6262
DWARFExpression Expr(DE, 8);
6363

6464
auto GetRegName = [&](uint64_t DwarfRegNum, bool IsEH) -> StringRef {
65-
if (std::optional<unsigned> LLVMRegNum =
65+
if (std::optional<MCRegister> LLVMRegNum =
6666
this->MRI->getLLVMRegNum(DwarfRegNum, IsEH))
6767
if (const char *RegName = this->MRI->getName(*LLVMRegNum))
6868
return llvm::StringRef(RegName);

0 commit comments

Comments
 (0)