summaryrefslogtreecommitdiffstats
path: root/clang/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
commit20871481d24ff1be86d43485515bf4c9e999d9c1 (patch)
treec32adeacf0d58a88f4e9a7b2b48214565d9acba5 /clang/lib/CodeGen/CGVtable.h
parente8595036c4111a58c60c1b33402f45026ed49976 (diff)
downloadbcm5719-llvm-20871481d24ff1be86d43485515bf4c9e999d9c1.tar.gz
bcm5719-llvm-20871481d24ff1be86d43485515bf4c9e999d9c1.zip
Add a BaseSubobject class to uniquely identify a base class subobject. Not yet used.
llvm-svn: 93345
Diffstat (limited to 'clang/lib/CodeGen/CGVtable.h')
-rw-r--r--clang/lib/CodeGen/CGVtable.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVtable.h b/clang/lib/CodeGen/CGVtable.h
index d1ffe7daa90..b4798141230 100644
--- a/clang/lib/CodeGen/CGVtable.h
+++ b/clang/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> >
OpenPOWER on IntegriCloud