1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/include/llvm
Duncan P. N. Exon Smith 41883f05fc CodeGen: Be clear about semantics in SlotIndex::getNextSlot(), NFC
Be honest about using iterator semantics in `SlotIndex::getNextSlot()`
and `SlotIndex::getPrevSlot()`.  Instead of calling `getNextNode()` --
which is documented (but fails) to check for the sentinel -- call
`&*++getIterator()`.

This is (surprisingly!) a NFC commit.  `ilist_traits<IndexListEntry>`
has an `ilist_half_node<IndexListEntry>` as a sentinel (and no other
fields), and so the layout of `ilist<IndexListEntry>` is:
--
struct ilist<IndexListEntry> {
  ilist_half_node<IndexListEntry> Sentinel;
  IndexListEntry *Head;

  IndexListEntry *getHead() { return Head; }
  IndexListEntry *getSentinel() { return cast<...>(&Sentinel); }
};
--
In memory, this happens to look just like:
--
struct ilist<IndexListEntry> {
  ilist_node<IndexListEntry> Sentinel;

  IndexListEntry *getHead() { return Sentinel.getNext(); }
  IndexListEntry *getSentinel() { return cast<...>(&Sentinel); }
};
--
As a result, `ilist_node<IndexListEntry>::getNextNode()` that checks
`getNext()` of the possible sentinel will get a pointer to the head of
the list; it will never detect the sentinel, and will return the
sentinel itself instead of `nullptr` in the special cases.

Since `getNextNode()` and `getPrevNode()` don't work, just be honest
that we're not checking for the end/beginning of the list here.  Since
this code works, I guess we must never go past the sentinel.

(It's possible we're just getting lucky, and the new code will get
"lucky" in the same situations.  To properly fix that hypothetical bug,
we would need to check the iterator against `end()`/`begin()`.)

llvm-svn: 252538
2015-11-09 23:31:01 +00:00
..
ADT Reapply "ADT: Require explicit ilist iterator/pointer conversions" 2015-11-07 00:59:29 +00:00
Analysis Fix -Wdeprecated warnings due to the use of copy ops on SCEVPredicate derived class objects 2015-11-09 23:30:15 +00:00
AsmParser AsmParser: Save and restore the parsing state for types using SlotMapping. 2015-08-21 21:32:39 +00:00
Bitcode Add a method to the BitcodeReader to parse only the identification block 2015-11-09 02:46:41 +00:00
CodeGen CodeGen: Be clear about semantics in SlotIndex::getNextSlot(), NFC 2015-11-09 23:31:01 +00:00
Config Make the default triple optional by allowing an empty string 2015-09-16 05:34:32 +00:00
DebugInfo [LLVMSymbolize] Reduce indentation by using helper function. NFC. 2015-11-04 00:30:26 +00:00
ExecutionEngine Revert "Revert "[Orc] Directly emit machine code for the x86 resolver block and trampolines."" 2015-11-03 16:40:37 +00:00
IR [OperandBundles] Rename accessor, NFC 2015-11-07 01:56:04 +00:00
IRReader Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
LibDriver LibDriver: Replace references to lld-link2 with lld-link. 2015-08-06 19:00:42 +00:00
LineEditor Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Linker Restore "Support for ThinLTO function importing and symbol linking." 2015-11-03 00:14:15 +00:00
LTO Add a method to the BitcodeReader to parse only the identification block 2015-11-09 02:46:41 +00:00
MC [AsmParser] Provide target direct access to mnemonic token. Allow assignment parsing to be hooked by target. Allow target to specify if identifier is a label. 2015-11-09 00:15:45 +00:00
Object Reapply r250906 with many suggested updates from Rafael Espindola. 2015-11-05 19:24:56 +00:00
Option [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
Passes Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ProfileData [PGO] Instr func name var creation code refactoring 2015-11-09 00:01:22 +00:00
Support Add templated read/write to support::endian. 2015-11-09 21:34:45 +00:00
TableGen Re-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes" 2015-09-10 16:49:58 +00:00
Target [WinEH] Don't emit CATCHRET from visitCatchPad 2015-11-09 23:07:48 +00:00
Transforms Allow LLE/LD and the loop versioning infrastructure to use SCEV predicates 2015-11-09 13:26:09 +00:00
CMakeLists.txt
InitializePasses.h LLE 6/6: Add LoopLoadElimination pass 2015-11-03 23:50:08 +00:00
LinkAllIR.h
LinkAllPasses.h [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
module.modulemap llvm/module.modulemap: AVR.def should be textual header. 2015-10-24 00:25:18 +00:00
module.modulemap.build
Pass.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PassAnalysisSupport.h [LPM] Teach the legacy pass manager to support *using* an analysis 2015-08-19 03:02:12 +00:00
PassInfo.h Reformat partially. 2015-10-05 04:46:30 +00:00
PassRegistry.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
PassSupport.h Support: Clean up TSan annotations. 2015-08-18 22:31:24 +00:00