[cfe-commits] r94550 - /cfe/trunk/include/clang/Checker/PathSensitive/MemRegion.h

Ken Dyck ken.dyck at onsemi.com
Tue Jan 26 09:01:48 PST 2010


Author: kjdyck
Date: Tue Jan 26 11:01:47 2010
New Revision: 94550

URL: http://llvm.org/viewvc/llvm-project?rev=94550&view=rev
Log:
Replace inheritance of RegionRawOffset from std::pair with two private member
variables to improve readability and encapsulation.

Modified:
    cfe/trunk/include/clang/Checker/PathSensitive/MemRegion.h

Modified: cfe/trunk/include/clang/Checker/PathSensitive/MemRegion.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/MemRegion.h?rev=94550&r1=94549&r2=94550&view=diff

==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/MemRegion.h Tue Jan 26 11:01:47 2010
@@ -249,17 +249,20 @@
 
 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;





More information about the cfe-commits mailing list