| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BLOCKCOUNTER_H |
| 16 | #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BLOCKCOUNTER_H |
| 17 | |
| 18 | #include "llvm/Support/Allocator.h" |
| 19 | |
| 20 | namespace clang { |
| 21 | |
| 22 | class StackFrameContext; |
| 23 | |
| 24 | namespace ento { |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | class BlockCounter { |
| 30 | void *Data; |
| 31 | |
| 32 | BlockCounter(void *D) : Data(D) {} |
| 33 | |
| 34 | public: |
| 35 | BlockCounter() : Data(nullptr) {} |
| 36 | |
| 37 | unsigned getNumVisited(const StackFrameContext *CallSite, |
| 38 | unsigned BlockID) const; |
| 39 | |
| 40 | class Factory { |
| 41 | void *F; |
| 42 | public: |
| 43 | Factory(llvm::BumpPtrAllocator& Alloc); |
| 44 | ~Factory(); |
| 45 | |
| 46 | BlockCounter GetEmptyCounter(); |
| 47 | BlockCounter IncrementCount(BlockCounter BC, |
| 48 | const StackFrameContext *CallSite, |
| 49 | unsigned BlockID); |
| 50 | }; |
| 51 | |
| 52 | friend class Factory; |
| 53 | }; |
| 54 | |
| 55 | } |
| 56 | |
| 57 | } |
| 58 | |
| 59 | #endif |
| 60 | |