Skip to content

Commit 3d64f1e

Browse files
committed
Fix API change in MCInstrDesc
1 parent e2cae4c commit 3d64f1e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

llvm/lib/Target/X86/X86FixupGadgets.cpp

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -542,23 +542,19 @@ bool FixupGadgetsPass::hasImplicitUseOrDef(const MachineInstr &MI,
542542

543543
const MCInstrDesc &Desc = MI.getDesc();
544544

545-
const MCPhysReg *ImpDefs = Desc.getImplicitDefs();
546-
if (ImpDefs) {
547-
for (; *ImpDefs; ++ImpDefs) {
548-
unsigned w = getWidestRegForReg(*ImpDefs);
549-
if (w == Reg1 || w == Reg2) {
550-
return true;
551-
}
545+
const ArrayRef<MCPhysReg> ImpDefs = Desc.implicit_defs();
546+
for (MCPhysReg ImpDef : ImpDefs) {
547+
unsigned w = getWidestRegForReg(ImpDef);
548+
if (w == Reg1 || w == Reg2) {
549+
return true;
552550
}
553551
}
554552

555-
const MCPhysReg *ImpUses = Desc.getImplicitUses();
556-
if (ImpUses) {
557-
for (; *ImpUses; ++ImpUses) {
558-
unsigned w = getWidestRegForReg(*ImpUses);
559-
if (w == Reg1 || w == Reg2) {
560-
return true;
561-
}
553+
const ArrayRef<MCPhysReg> ImpUses = Desc.implicit_uses();
554+
for (MCPhysReg ImpUse : ImpUses) {
555+
unsigned w = getWidestRegForReg(ImpUse);
556+
if (w == Reg1 || w == Reg2) {
557+
return true;
562558
}
563559
}
564560
return false;

0 commit comments

Comments
 (0)