]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Analysis/PathSensitive/GRBlockCounter.h
Update clang to r94309.
[FreeBSD/FreeBSD.git] / include / clang / Analysis / PathSensitive / GRBlockCounter.h
1 //==- GRBlockCounter.h - ADT for counting block visits -------------*- 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 //  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.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_CLANG_ANALYSIS_GRBLOCKCOUNTER
17 #define LLVM_CLANG_ANALYSIS_GRBLOCKCOUNTER
18
19 namespace llvm {
20   class BumpPtrAllocator;
21 }
22
23 namespace clang {
24
25 class GRBlockCounter {
26   void* Data;
27
28   GRBlockCounter(void* D) : Data(D) {}
29
30 public:
31   GRBlockCounter() : Data(0) {}
32
33   unsigned getNumVisited(unsigned BlockID) const;
34
35   class Factory {
36     void* F;
37   public:
38     Factory(llvm::BumpPtrAllocator& Alloc);
39     ~Factory();
40
41     GRBlockCounter GetEmptyCounter();
42     GRBlockCounter IncrementCount(GRBlockCounter BC, unsigned BlockID);
43   };
44
45   friend class Factory;
46 };
47
48 } // end clang namespace
49
50 #endif