[lld] r278523 - MachO: Use ilist_half_embedded_sentinel_traits, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 12 09:25:04 PDT 2016
Author: dexonsmith
Date: Fri Aug 12 11:25:04 2016
New Revision: 278523
URL: http://llvm.org/viewvc/llvm-project?rev=278523&view=rev
Log:
MachO: Use ilist_half_embedded_sentinel_traits, NFC
Use ilist_half_embedded_sentinel_traits for the list of
lld::mach_o::normalized::TrieEdge, rather than duplicating the code.
Modified:
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp?rev=278523&r1=278522&r2=278523&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp Fri Aug 12 11:25:04 2016
@@ -68,19 +68,11 @@ struct TrieEdge : public llvm::ilist_nod
namespace llvm {
using lld::mach_o::normalized::TrieEdge;
template <>
- struct ilist_traits<TrieEdge>
- : public ilist_default_traits<TrieEdge> {
- private:
- mutable ilist_half_node<TrieEdge> Sentinel;
- public:
- TrieEdge *createSentinel() const {
- return static_cast<TrieEdge*>(&Sentinel);
- }
- void destroySentinel(TrieEdge *) const {}
+ struct ilist_sentinel_traits<TrieEdge>
+ : public ilist_half_embedded_sentinel_traits<TrieEdge> {};
- TrieEdge *provideInitialHead() const { return createSentinel(); }
- TrieEdge *ensureHead(TrieEdge*) const { return createSentinel(); }
- static void noteHead(TrieEdge*, TrieEdge*) {}
+ template <>
+ struct ilist_traits<TrieEdge> : public ilist_default_traits<TrieEdge> {
void deleteNode(TrieEdge *N) {}
private:
More information about the llvm-commits
mailing list