mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-02 23:26:31 +00:00
Phase 1 of refactoring the MachineRegisterInfo iterators to make them suitable
for use with C++11 range-based for-loops. The gist of phase 1 is to remove the skipInstruction() and skipBundle() methods from these iterators, instead splitting each iterator into a version that walks operands, a version that walks instructions, and a version that walks bundles. This has the result of making some "clever" loops in lib/CodeGen more verbose, but also makes their iterator invalidation characteristics much more obvious to the casual reader. (Making them concise again in the future is a good motivating case for a pre-incrementing range adapter!) Phase 2 of this undertaking with consist of removing the getOperand() method, and changing operator*() of the operand-walker to return a MachineOperand&. At that point, it should be possible to add range views for them that work as one might expect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203757 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -483,9 +483,10 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
|
||||
// that COPY instructions also need DBG_VALUE, if it is the only
|
||||
// user of LDI->second.
|
||||
MachineInstr *CopyUseMI = NULL;
|
||||
for (MachineRegisterInfo::use_iterator
|
||||
UI = RegInfo->use_begin(LDI->second);
|
||||
MachineInstr *UseMI = UI.skipInstruction();) {
|
||||
for (MachineRegisterInfo::use_instr_iterator
|
||||
UI = RegInfo->use_instr_begin(LDI->second),
|
||||
E = RegInfo->use_instr_end(); UI != E; ) {
|
||||
MachineInstr *UseMI = &*(UI++);
|
||||
if (UseMI->isDebugValue()) continue;
|
||||
if (UseMI->isCopy() && !CopyUseMI && UseMI->getParent() == EntryMBB) {
|
||||
CopyUseMI = UseMI; continue;
|
||||
|
Reference in New Issue
Block a user