Skip to content

Commit 94a0b34

Browse files
author
Chen Zheng
committed
address comments
1 parent 7c1e444 commit 94a0b34

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -916,16 +916,15 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
916916
// handled in PPCLinuxAsmPrinter.
917917
if (MAI->isLittleEndian())
918918
return;
919-
const Function &F = MI->getParent()->getParent()->getFunction();
920-
if (F.hasFnAttribute("patchable-function-entry")) {
921-
unsigned Num = 0;
922-
if (F.getFnAttribute("patchable-function-entry")
923-
.getValueAsString()
924-
.getAsInteger(10, Num))
925-
return;
926-
emitNops(Num);
919+
const Function &F = MF->getFunction();
920+
unsigned Num = 0;
921+
(void)F.getFnAttribute("patchable-function-entry")
922+
.getValueAsString()
923+
.getAsInteger(10, Num);
924+
if (!Num)
927925
return;
928-
}
926+
emitNops(Num);
927+
return;
929928
}
930929
case TargetOpcode::DBG_VALUE:
931930
llvm_unreachable("Should be handled target independently");

0 commit comments

Comments
 (0)