1 //==- GRBlockCounter.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 GRBlockCounter, an abstract data type used to count
11 // the number of times a given block has been visited along a path
12 // analyzed by GRCoreEngine.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_ANALYSIS_GRBLOCKCOUNTER
17 #define LLVM_CLANG_ANALYSIS_GRBLOCKCOUNTER
20 class BumpPtrAllocator;
25 class GRBlockCounter {
28 GRBlockCounter(void* D) : Data(D) {}
31 GRBlockCounter() : Data(0) {}
33 unsigned getNumVisited(unsigned BlockID) const;
38 Factory(llvm::BumpPtrAllocator& Alloc);
41 GRBlockCounter GetEmptyCounter();
42 GRBlockCounter IncrementCount(GRBlockCounter BC, unsigned BlockID);
48 } // end clang namespace