[cfe-commits] r93345 - /cfe/trunk/lib/CodeGen/CGVtable.h

Anders Carlsson andersca at mac.com
Wed Jan 13 12:11:16 PST 2010


Author: andersca
Date: Wed Jan 13 14:11:15 2010
New Revision: 93345

URL: http://llvm.org/viewvc/llvm-project?rev=93345&view=rev
Log:
Add a BaseSubobject class to uniquely identify a base class subobject. Not yet used.

Modified:
    cfe/trunk/lib/CodeGen/CGVtable.h

Modified: cfe/trunk/lib/CodeGen/CGVtable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.h?rev=93345&r1=93344&r2=93345&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.h (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.h Wed Jan 13 14:11:15 2010
@@ -61,6 +61,31 @@
   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> >





More information about the cfe-commits mailing list