NVPTX: Avoid implicit iterator conversions, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 8 Jul 2016 21:10:58 +0000 (21:10 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 8 Jul 2016 21:10:58 +0000 (21:10 +0000)
commit68f499a6fa5e3b52b08f920f61d6f73f9aa57bcf
tree576c80781509c5034f3733463f3ac5f7c621ee7a
parent1002373946a7c8452cd1a75b4f67515b49b43e3f
NVPTX: Avoid implicit iterator conversions, NFC

Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr* in the NVPTX backend, mainly by preferring MachineInstr&
over MachineInstr* when a pointer isn't nullable and using range-based
for loops.

There was one piece of questionable code in
NVPTXInstrInfo::AnalyzeBranch, where a condition checked a pointer
converted from an iterator for nullptr.  Since this case is impossible
(moreover, the code above guarantees that the iterator is valid), I
removed the check when I changed the pointer to a reference.

Despite that case, there should be no functionality change here.

llvm-svn: 274931
llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp
llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp
llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp