1 //==- BlockCounter.h - ADT for counting block visits ---------------*- C++ -*-//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines BlockCounter, an abstract data type used to count
11 // the number of times a given block has been visited along a path
12 // analyzed by CoreEngine.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BLOCKCOUNTER_H
17 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BLOCKCOUNTER_H
19 #include "llvm/Support/Allocator.h"
23 class StackFrameContext;
27 /// \class BlockCounter
28 /// \brief An abstract data type used to count the number of times a given
29 /// block has been visited along a path analyzed by CoreEngine.
33 BlockCounter(void *D) : Data(D) {}
36 BlockCounter() : Data(nullptr) {}
38 unsigned getNumVisited(const StackFrameContext *CallSite,
39 unsigned BlockID) const;
44 Factory(llvm::BumpPtrAllocator& Alloc);
47 BlockCounter GetEmptyCounter();
48 BlockCounter IncrementCount(BlockCounter BC,
49 const StackFrameContext *CallSite,
58 } // end clang namespace