opnsense-src/include/clang/Checker/PathSensitive/GRBlockCounter.h

51 lines
1.2 KiB
C
Raw Normal View History

2009-06-02 13:58:47 -04:00
//==- GRBlockCounter.h - ADT for counting block visits -------------*- C++ -*-//
2009-10-14 14:03:49 -04:00
//
2009-06-02 13:58:47 -04:00
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines GRBlockCounter, an abstract data type used to count
// the number of times a given block has been visited along a path
// analyzed by GRCoreEngine.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_ANALYSIS_GRBLOCKCOUNTER
#define LLVM_CLANG_ANALYSIS_GRBLOCKCOUNTER
namespace llvm {
class BumpPtrAllocator;
}
namespace clang {
class GRBlockCounter {
void* Data;
2009-10-14 14:03:49 -04:00
GRBlockCounter(void* D) : Data(D) {}
2009-06-02 13:58:47 -04:00
public:
GRBlockCounter() : Data(0) {}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
unsigned getNumVisited(unsigned BlockID) const;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
class Factory {
void* F;
public:
Factory(llvm::BumpPtrAllocator& Alloc);
~Factory();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
GRBlockCounter GetEmptyCounter();
GRBlockCounter IncrementCount(GRBlockCounter BC, unsigned BlockID);
};
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
friend class Factory;
};
} // end clang namespace
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
#endif