llvm/compiler-rt/lib/tsan/rtl/tsan_ilist.h

//===-- tsan_ilist.h --------------------------------------------*- 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
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
//===----------------------------------------------------------------------===//
#ifndef TSAN_ILIST_H
#define TSAN_ILIST_H

#include "sanitizer_common/sanitizer_internal_defs.h"

namespace __tsan {

class INode {};

// Intrusive doubly-linked list.
//
// The node class (MyNode) needs to include "INode foo" field,
// then the list can be declared as IList<MyNode, &MyNode::foo>.
// This design allows to link MyNode into multiple lists using
// different INode fields.
// The optional Elem template argument allows to specify node MDT
// (most derived type) if it's different from MyNode.
template <typename Base, INode Base::*Node, typename Elem = Base>
class IList {};

template <typename Base, INode Base::*Node, typename Elem>
IList<Base, Node, Elem>::IList() {}

template <typename Base, INode Base::*Node, typename Elem>
void IList<Base, Node, Elem>::PushFront(Elem* e) {}

template <typename Base, INode Base::*Node, typename Elem>
void IList<Base, Node, Elem>::PushBack(Elem* e) {}

template <typename Base, INode Base::*Node, typename Elem>
void IList<Base, Node, Elem>::Push(Elem* e, INode* after) {}

template <typename Base, INode Base::*Node, typename Elem>
void IList<Base, Node, Elem>::Remove(Elem* e) {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::PopFront() {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::PopBack() {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::Front() {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::Back() {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::Prev(Elem* e) {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::Next(Elem* e) {}

template <typename Base, INode Base::*Node, typename Elem>
uptr IList<Base, Node, Elem>::Size() const {}

template <typename Base, INode Base::*Node, typename Elem>
bool IList<Base, Node, Elem>::Empty() const {}

template <typename Base, INode Base::*Node, typename Elem>
bool IList<Base, Node, Elem>::Queued(Elem* e) const {}

template <typename Base, INode Base::*Node, typename Elem>
INode* IList<Base, Node, Elem>::ToNode(Elem* e) {}

template <typename Base, INode Base::*Node, typename Elem>
Elem* IList<Base, Node, Elem>::ToElem(INode* n) {}

}  // namespace __tsan

#endif