]> granicus.if.org Git - clang/commitdiff
Replace inheritance of RegionRawOffset from std::pair with two private member
authorKen Dyck <ken.dyck@onsemi.com>
Tue, 26 Jan 2010 17:01:47 +0000 (17:01 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Tue, 26 Jan 2010 17:01:47 +0000 (17:01 +0000)
variables to improve readability and encapsulation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94550 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Checker/PathSensitive/MemRegion.h

index e1b21b16e2d54ef623c1f610f1a3f09a080a2710..12bc0b795685a7fc9b3ee7e71401d7b1275a8379 100644 (file)
@@ -249,17 +249,20 @@ public:
 
 class ElementRegion;
 
-class RegionRawOffset : public std::pair<const MemRegion*, int64_t> {
+class RegionRawOffset {
 private:
   friend class ElementRegion;
 
+  const MemRegion *Region;
+  int64_t Offset;
+
   RegionRawOffset(const MemRegion* reg, int64_t offset = 0)
-    : std::pair<const MemRegion*, int64_t>(reg, offset) {}
+    : Region(reg), Offset(offset) {}
 
 public:
   // FIXME: Eventually support symbolic offsets.
-  int64_t getByteOffset() const { return second; }
-  const MemRegion *getRegion() const { return first; }
+  int64_t getByteOffset() const { return Offset; }
+  const MemRegion *getRegion() const { return Region; }
 
   void dumpToStream(llvm::raw_ostream& os) const;
   void dump() const;