diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-10-02 17:12:02 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-10-02 17:12:02 +0000 |
commit | 4d20f2dd79e7829ade5e23945a2ef65a8fe1cf39 (patch) | |
tree | 97a4d19bbf9967fa071bc3c788b740b686732233 /include/clang/Analysis/FlowSensitive/DataflowValues.h | |
parent | 8f3fde00ad4d4f943321e338b914ae4740711c84 (diff) |
Moved ProgramEdge out out include/.../Analysis/PathSensitive to include/.../Analysis, as it is now used by the FlowSensitive subsystem as well.
Removed "Edge" nested class by CFG, as it is now subsumed by ProgramEdge.
Adjusted DataflowSolver and DataflowValues to use ProgramEdges instead
of CFG::Edge.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/FlowSensitive/DataflowValues.h')
-rw-r--r-- | include/clang/Analysis/FlowSensitive/DataflowValues.h | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/include/clang/Analysis/FlowSensitive/DataflowValues.h b/include/clang/Analysis/FlowSensitive/DataflowValues.h index aa061127ac..5a29ab6a83 100644 --- a/include/clang/Analysis/FlowSensitive/DataflowValues.h +++ b/include/clang/Analysis/FlowSensitive/DataflowValues.h @@ -17,43 +17,10 @@ #define LLVM_CLANG_ANALYSES_DATAFLOW_VALUES #include "clang/AST/CFG.h" +#include "clang/Analysis/ProgramEdge.h" #include "llvm/ADT/DenseMap.h" //===----------------------------------------------------------------------===// -// DenseMapInfo for CFG::Edge for use with DenseMap -//===----------------------------------------------------------------------===// - -namespace llvm { - - template <> struct DenseMapInfo<clang::CFG::Edge> { - static inline clang::CFG::Edge getEmptyKey() { - return clang::CFG::Edge(NULL,NULL); - } - - static inline clang::CFG::Edge getTombstoneKey() { - return clang::CFG::Edge(NULL,reinterpret_cast<clang::CFGBlock*>(-1)); - } - - static unsigned getHashValue(const clang::CFG::Edge& E) { - const clang::CFGBlock* P1 = E.getSrc(); - const clang::CFGBlock* P2 = E.getDst(); - return static_cast<unsigned>((reinterpret_cast<uintptr_t>(P1) >> 4) ^ - (reinterpret_cast<uintptr_t>(P1) >> 9) ^ - (reinterpret_cast<uintptr_t>(P2) >> 5) ^ - (reinterpret_cast<uintptr_t>(P2) >> 10)); - } - - static bool isEqual(const clang::CFG::Edge& LHS, - const clang::CFG::Edge& RHS) { - return LHS == RHS; - } - - static bool isPod() { return true; } - }; - -} // end namespace llvm - -//===----------------------------------------------------------------------===// /// Dataflow Directional Tag Classes. These are used for tag dispatching /// within the dataflow solver/transfer functions to determine what direction /// a dataflow analysis flows. @@ -81,7 +48,7 @@ public: typedef typename ValueTypes::ValTy ValTy; typedef typename ValueTypes::AnalysisDataTy AnalysisDataTy; typedef _AnalysisDirTag AnalysisDirTag; - typedef llvm::DenseMap<CFG::Edge, ValTy> EdgeDataMapTy; + typedef llvm::DenseMap<ProgramEdge, ValTy> EdgeDataMapTy; typedef llvm::DenseMap<const CFGBlock*, ValTy> BlockDataMapTy; //===--------------------------------------------------------------------===// @@ -113,13 +80,13 @@ public: /// getEdgeData - Retrieves the dataflow values associated with a /// CFG edge. - ValTy& getEdgeData(const CFG::Edge& E) { + ValTy& getEdgeData(const BlkBlkEdge& E) { typename EdgeDataMapTy::iterator I = EdgeDataMap.find(E); assert (I != EdgeDataMap.end() && "No data associated with Edge."); return I->second; } - const ValTy& getEdgeData(const CFG::Edge& E) const { + const ValTy& getEdgeData(const BlkBlkEdge& E) const { return reinterpret_cast<DataflowValues*>(this)->getEdgeData(E); } |