diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-09-18 18:01:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-09-18 18:01:15 +0000 |
commit | 4c64e8ee46ad6e2336f9c160a79eded6b16c68f8 (patch) | |
tree | b352e305eada792930258dc25f835e5c9ea50c1d | |
parent | 2f94f3ce15f6954876707cefd2b932853db46870 (diff) |
Added type "CFG::Edge" to encapsulate the notion of directed-edges
within source-level CFGs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42098 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/CFG.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/clang/AST/CFG.h b/include/clang/AST/CFG.h index f940a534c8..2772d18580 100644 --- a/include/clang/AST/CFG.h +++ b/include/clang/AST/CFG.h @@ -212,6 +212,33 @@ public: CFGBlock* getIndirectGotoBlock() { return IndirectGotoBlock; } const CFGBlock* getIndirectGotoBlock() const { return IndirectGotoBlock; } + // Edges + + class Edge { + const CFGBlock* Src; + const CFGBlock* Dst; + public: + Edge(const CFGBlock* src, const CFGBlock* dst) : Src(src), Dst(dst) {} + Edge(const Edge& RHS) : Src(RHS.Src), Dst(RHS.Dst) {} + + Edge& operator=(const Edge& RHS) { + Src = RHS.Src; + Dst = RHS.Dst; + return *this; + } + + const CFGBlock* getSrc() const { return Src; } + const CFGBlock* getDst() const { return Dst; } + + bool operator==(const Edge& RHS) const { + return Src == RHS.Src && Dst == RHS.Dst; + } + + bool operator!=(const Edge& RHS) const { + return !(*this == RHS); + } + }; + // Utility CFGBlock* createBlock(); |