1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 22:12:57 +02:00
llvm-mirror/lib/CodeGen/AsmPrinter
Duncan P. N. Exon Smith 701b7a130a CodeGen: Give MachineBasicBlock::reverse_iterator a handle to the current MI
Now that MachineBasicBlock::reverse_instr_iterator knows when it's at
the end (since r281168 and r281170), implement
MachineBasicBlock::reverse_iterator directly on top of an
ilist::reverse_iterator by adding an IsReverse template parameter to
MachineInstrBundleIterator.  This replaces another hard-to-reason-about
use of std::reverse_iterator on list iterators, matching the changes for
ilist::reverse_iterator from r280032 (see the "out of scope" section at
the end of that commit message).  MachineBasicBlock::reverse_iterator
now has a handle to the current node and has obvious invalidation
semantics.

r280032 has a more detailed explanation of how list-style reverse
iterators (invalidated when the pointed-at node is deleted) are
different from vector-style reverse iterators like std::reverse_iterator
(invalidated on every operation).  A great motivating example is this
commit's changes to lib/CodeGen/DeadMachineInstructionElim.cpp.

Note: If your out-of-tree backend deletes instructions while iterating
on a MachineBasicBlock::reverse_iterator or converts between
MachineBasicBlock::iterator and MachineBasicBlock::reverse_iterator,
you'll need to update your code in similar ways to r280032.  The
following table might help:

                  [Old]              ==>             [New]
        delete &*RI, RE = end()                   delete &*RI++
        RI->erase(), RE = end()                   RI++->erase()
      reverse_iterator(I)                 std::prev(I).getReverse()
      reverse_iterator(I)                          ++I.getReverse()
    --reverse_iterator(I)                            I.getReverse()
      reverse_iterator(std::next(I))                 I.getReverse()
                RI.base()                std::prev(RI).getReverse()
                RI.base()                         ++RI.getReverse()
              --RI.base()                           RI.getReverse()
     std::next(RI).base()                           RI.getReverse()

(For more details, have a look at r280032.)

llvm-svn: 281172
2016-09-11 18:51:28 +00:00
..
AddressPool.cpp Move helpers into anonymous namespaces. NFC. 2016-08-06 11:13:10 +00:00
AddressPool.h
ARMException.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
AsmPrinter.cpp Revert "[XRay] ARM 32-bit no-Thumb support in LLVM" 2016-09-08 17:10:39 +00:00
AsmPrinterDwarf.cpp CodeGen: Do not require a MachineFunction just to create a DIEDwarfExpression. 2016-05-20 19:35:17 +00:00
AsmPrinterHandler.h
AsmPrinterInlineAsm.cpp
ByteStreamer.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
CMakeLists.txt
CodeViewDebug.cpp [pdb] Write PDB TPI Stream from Yaml. 2016-09-09 17:46:17 +00:00
CodeViewDebug.h [pdb] Write PDB TPI Stream from Yaml. 2016-09-09 17:46:17 +00:00
DbgValueHistoryCalculator.cpp CodeGen: Give MachineBasicBlock::reverse_iterator a handle to the current MI 2016-09-11 18:51:28 +00:00
DbgValueHistoryCalculator.h
DebugHandlerBase.cpp [MC] Move .cv_loc management logic out of MCContext 2016-08-26 17:58:37 +00:00
DebugHandlerBase.h [codeview] Improved array type support. 2016-07-12 12:06:34 +00:00
DebugLocEntry.h Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
DebugLocStream.cpp
DebugLocStream.h
DIE.cpp Replace a few more "fall through" comments with LLVM_FALLTHROUGH 2016-08-17 20:30:52 +00:00
DIEHash.cpp Apply another batch of fixes from clang-tidy's performance-unnecessary-value-param. 2016-06-17 20:41:14 +00:00
DIEHash.h Apply another batch of fixes from clang-tidy's performance-unnecessary-value-param. 2016-06-17 20:41:14 +00:00
DwarfAccelTable.cpp
DwarfAccelTable.h
DwarfCFIException.cpp CodeGen: avoid emitting unnecessary CFI 2016-07-15 21:10:29 +00:00
DwarfCompileUnit.cpp [COFF, Dwarf] Don't emit DW_AT_location for dllimported entities 2016-07-09 20:47:48 +00:00
DwarfCompileUnit.h Reverting 268054 & 268063 as they caused PR27579. 2016-04-30 01:44:07 +00:00
DwarfDebug.cpp Make some LLVM_CONSTEXPR variables const. NFC. 2016-08-25 01:05:08 +00:00
DwarfDebug.h Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
DwarfException.h
DwarfExpression.cpp Fix the type signature of DwarfExpression::Add.*Constant to support values >32 bits. 2016-06-24 21:35:09 +00:00
DwarfExpression.h Fix the type signature of DwarfExpression::Add.*Constant to support values >32 bits. 2016-06-24 21:35:09 +00:00
DwarfFile.cpp
DwarfFile.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
DwarfStringPool.cpp
DwarfStringPool.h
DwarfUnit.cpp Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-08-25 00:45:04 +00:00
DwarfUnit.h Reverting 268054 & 268063 as they caused PR27579. 2016-04-30 01:44:07 +00:00
EHStreamer.cpp
EHStreamer.h
ErlangGCPrinter.cpp
LLVMBuild.txt [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
OcamlGCPrinter.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
WinException.cpp MachineFunction: Return reference for getFrameInfo(); NFC 2016-07-28 18:40:00 +00:00
WinException.h