LCOV - code coverage report
Current view: top level - include/llvm/ADT - ilist_node_base.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 7 12 58.3 %
Date: 2018-10-20 13:21:21 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- llvm/ADT/ilist_node_base.h - Intrusive List Node Base -----*- C++ -*-==//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : 
      10             : #ifndef LLVM_ADT_ILIST_NODE_BASE_H
      11             : #define LLVM_ADT_ILIST_NODE_BASE_H
      12             : 
      13             : #include "llvm/ADT/PointerIntPair.h"
      14             : 
      15             : namespace llvm {
      16             : 
      17             : /// Base class for ilist nodes.
      18             : ///
      19             : /// Optionally tracks whether this node is the sentinel.
      20             : template <bool EnableSentinelTracking> class ilist_node_base;
      21             : 
      22   172074899 : template <> class ilist_node_base<false> {
      23             :   ilist_node_base *Prev = nullptr;
      24             :   ilist_node_base *Next = nullptr;
      25             : 
      26             : public:
      27   427083676 :   void setPrev(ilist_node_base *Prev) { this->Prev = Prev; }
      28   210118789 :   void setNext(ilist_node_base *Next) { this->Next = Next; }
      29           0 :   ilist_node_base *getPrev() const { return Prev; }
      30           0 :   ilist_node_base *getNext() const { return Next; }
      31             : 
      32           0 :   bool isKnownSentinel() const { return false; }
      33           0 :   void initializeSentinel() {}
      34             : };
      35             : 
      36    52582194 : template <> class ilist_node_base<true> {
      37             :   PointerIntPair<ilist_node_base *, 1> PrevAndSentinel;
      38             :   ilist_node_base *Next = nullptr;
      39             : 
      40             : public:
      41             :   void setPrev(ilist_node_base *Prev) { PrevAndSentinel.setPointer(Prev); }
      42   136680199 :   void setNext(ilist_node_base *Next) { this->Next = Next; }
      43   177813734 :   ilist_node_base *getPrev() const { return PrevAndSentinel.getPointer(); }
      44           0 :   ilist_node_base *getNext() const { return Next; }
      45             : 
      46   609319248 :   bool isSentinel() const { return PrevAndSentinel.getInt(); }
      47             :   bool isKnownSentinel() const { return isSentinel(); }
      48             :   void initializeSentinel() { PrevAndSentinel.setInt(true); }
      49             : };
      50             : 
      51             : } // end namespace llvm
      52             : 
      53             : #endif // LLVM_ADT_ILIST_NODE_BASE_H

Generated by: LCOV version 1.13