diff options
author | Anna Zaks <ganna@apple.com> | 2011-10-07 20:08:27 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-10-07 20:08:27 +0000 |
commit | af42712cd8f548f15c700d49a7038ddb846aafa8 (patch) | |
tree | 4e9d94d2c17448c4c4aacf67779ed3caa2a14a5f /include/clang/Analysis/ProgramPoint.h | |
parent | 209f5bb70b5719e06a64fa6fa1435e6e1f76502a (diff) |
Add a copy constructor to ProgramPoint and pull withTag() method from a child. (withTag essentialy creates a copy with a given tag.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r-- | include/clang/Analysis/ProgramPoint.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 2ff2be9fa1..e35c479add 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -78,6 +78,15 @@ protected: const void *getData2() const { return Data.second; } public: + ProgramPoint(const ProgramPoint &P) + : Data(P.Data), K(P.K), L(P.L), Tag(P.Tag) {} + + /// Create a new ProgramPoint object that is the same as the original + /// except for using the specified tag value. + ProgramPoint withTag(const ProgramPointTag *tag) { + return ProgramPoint(Data.first, Data.second, K, L, tag); + } + Kind getKind() const { return K; } const ProgramPointTag *getTag() const { return Tag; } @@ -127,12 +136,6 @@ public: return B->empty() ? CFGElement() : B->front(); } - /// Create a new BlockEntrance object that is the same as the original - /// except for using the specified tag value. - BlockEntrance withTag(const ProgramPointTag *tag) { - return BlockEntrance(getBlock(), getLocationContext(), tag); - } - static bool classof(const ProgramPoint* Location) { return Location->getKind() == BlockEntranceKind; } |