aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-01-13 20:11:15 +0000
committerAnders Carlsson <andersca@mac.com>2010-01-13 20:11:15 +0000
commit6b4333db17d0901eb832abfc1940e63cae43479b (patch)
treecafc2906f968aa981b42c8ae349042acb0b771cb /lib/CodeGen/CGVtable.h
parentcfb708c354e2f30ccc5cba9d644650f408a1ec3e (diff)
Add a BaseSubobject class to uniquely identify a base class subobject. Not yet used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.h')
-rw-r--r--lib/CodeGen/CGVtable.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.h b/lib/CodeGen/CGVtable.h
index d1ffe7daa9..b479814123 100644
--- a/lib/CodeGen/CGVtable.h
+++ b/lib/CodeGen/CGVtable.h
@@ -61,6 +61,31 @@ public:
ThunkAdjustment ReturnAdjustment;
};
+// BaseSubobject - Uniquely identifies a direct or indirect base class.
+// Stores both the base class decl and the offset from the most derived class to
+// the base class.
+class BaseSubobject {
+ /// Base - The base class declaration.
+ const CXXRecordDecl *Base;
+
+ /// BaseOffset - The offset from the most derived class to the base class.
+ uint64_t BaseOffset;
+
+public:
+ BaseSubobject(const CXXRecordDecl *Base, uint64_t BaseOffset)
+ : Base(Base), BaseOffset(BaseOffset) { }
+
+ /// getBase - Returns the base class declaration.
+ const CXXRecordDecl *getBase() const { return Base; }
+
+ /// getBaseOffset - Returns the base class offset.
+ uint64_t getBaseOffset() const { return BaseOffset; }
+
+ friend bool operator==(const BaseSubobject &LHS, const BaseSubobject &RHS) {
+ return LHS.Base == RHS.Base && LHS.BaseOffset == RHS.BaseOffset;
+ }
+};
+
class CGVtableInfo {
public:
typedef std::vector<std::pair<GlobalDecl, ThunkAdjustment> >