From af42712cd8f548f15c700d49a7038ddb846aafa8 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Fri, 7 Oct 2011 20:08:27 +0000 Subject: [PATCH] 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 --- include/clang/Analysis/ProgramPoint.h | 15 +++++++++------ 1 file 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; } -- 2.40.0