llvm/llvm/include/llvm/ADT/ilist_node_base.h

//===- llvm/ADT/ilist_node_base.h - Intrusive List Node Base -----*- C++ -*-==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ADT_ILIST_NODE_BASE_H
#define LLVM_ADT_ILIST_NODE_BASE_H

#include "llvm/ADT/PointerIntPair.h"

namespace llvm {

namespace ilist_detail {

template <class NodeBase, bool EnableSentinelTracking> class node_base_prevnext;

node_base_prevnext<NodeBase, false>;

node_base_prevnext<NodeBase, true>;

template <class ParentTy> class node_base_parent {};
template <> class node_base_parent<void> {};

} // end namespace ilist_detail

/// Base class for ilist nodes.
///
/// Optionally tracks whether this node is the sentinel.
template <bool EnableSentinelTracking, class ParentTy>
class ilist_node_base : public ilist_detail::node_base_prevnext<
                            ilist_node_base<EnableSentinelTracking, ParentTy>,
                            EnableSentinelTracking>,
                        public ilist_detail::node_base_parent<ParentTy> {};

} // end namespace llvm

#endif // LLVM_ADT_ILIST_NODE_BASE_H