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_GR_BLOCKCOUNTER
17 #define LLVM_CLANG_GR_BLOCKCOUNTER
20 class BumpPtrAllocator;
25 class StackFrameContext;
29 /// \class BlockCounter
30 /// \brief An abstract data type used to count the number of times a given
31 /// block has been visited along a path analyzed by CoreEngine.
35 BlockCounter(void *D) : Data(D) {}
38 BlockCounter() : Data(0) {}
40 unsigned getNumVisited(const StackFrameContext *CallSite,
41 unsigned BlockID) const;
46 Factory(llvm::BumpPtrAllocator& Alloc);
49 BlockCounter GetEmptyCounter();
50 BlockCounter IncrementCount(BlockCounter BC,
51 const StackFrameContext *CallSite,
60 } // end clang namespace