diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-10-20 00:46:39 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-10-20 00:46:39 +0000 |
commit | a72c6e25ec815b11a78c1b9bd32ab1e77b8244e5 (patch) | |
tree | 7daf356769a1f6ada3337ffedb3cfaa7589f3a84 /llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp | |
parent | 3b0177c542c22ee161e469e39fcb2fa1dc4f193e (diff) | |
download | bcm5719-llvm-a72c6e25ec815b11a78c1b9bd32ab1e77b8244e5.tar.gz bcm5719-llvm-a72c6e25ec815b11a78c1b9bd32ab1e77b8244e5.zip |
Hexagon: Remove implicit ilist iterator conversions, NFC
There are two things out of the ordinary in this commit. First, I made
a loop obviously "infinite" in HexagonInstrInfo.cpp. After checking if
an instruction was at the beginning of a basic block (in which case,
`break`), the loop decremented and checked the iterator for `nullptr` as
the loop condition. This has never been possible (the prev pointers are
always been circular, so even with the weird ilist/iplist
implementation, this isn't been possible), so I removed the condition.
Second, in HexagonAsmPrinter.cpp there was another case of comparing a
`MachineBasicBlock::instr_iterator` against `MachineBasicBlock::end()`
(which returns `MachineBasicBlock::iterator`). While not incorrect,
it's fragile. I switched this to `::instr_end()`.
All that said, no functionality change intended here.
llvm-svn: 250778
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp b/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp index 05728d2b627..b5e423ef2b4 100644 --- a/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp +++ b/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp @@ -184,15 +184,15 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) { if (MI->isBundle()) { const MachineBasicBlock* MBB = MI->getParent(); - MachineBasicBlock::const_instr_iterator MII = MI; + MachineBasicBlock::const_instr_iterator MII = MI->getIterator(); unsigned IgnoreCount = 0; - for (++MII; MII != MBB->end() && MII->isInsideBundle(); ++MII) { + for (++MII; MII != MBB->instr_end() && MII->isInsideBundle(); ++MII) { if (MII->getOpcode() == TargetOpcode::DBG_VALUE || MII->getOpcode() == TargetOpcode::IMPLICIT_DEF) ++IgnoreCount; else { - HexagonLowerToMC(MII, MCB, *this); + HexagonLowerToMC(&*MII, MCB, *this); } } } |