From: Ken Dyck Date: Tue, 26 Jan 2010 17:01:47 +0000 (+0000) Subject: Replace inheritance of RegionRawOffset from std::pair with two private member X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b896f625d1225450c0b30c4b82cb4d9af5642b9f;p=clang Replace inheritance of RegionRawOffset from std::pair with two private member variables to improve readability and encapsulation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94550 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Checker/PathSensitive/MemRegion.h b/include/clang/Checker/PathSensitive/MemRegion.h index e1b21b16e2..12bc0b7956 100644 --- a/include/clang/Checker/PathSensitive/MemRegion.h +++ b/include/clang/Checker/PathSensitive/MemRegion.h @@ -249,17 +249,20 @@ public: class ElementRegion; -class RegionRawOffset : public std::pair { +class RegionRawOffset { private: friend class ElementRegion; + const MemRegion *Region; + int64_t Offset; + RegionRawOffset(const MemRegion* reg, int64_t offset = 0) - : std::pair(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;