]> granicus.if.org Git - clang/commitdiff
Add a copy constructor to ProgramPoint and pull withTag() method from a child. (withT...
authorAnna Zaks <ganna@apple.com>
Fri, 7 Oct 2011 20:08:27 +0000 (20:08 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 7 Oct 2011 20:08:27 +0000 (20:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141408 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/ProgramPoint.h

index 2ff2be9fa13408331529ca441642412d497fde78..e35c479addb1548ea80c0e40ae1f5c3edd606596 100644 (file)
@@ -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;
   }