aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRecordLayout.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-11-09 05:25:47 +0000
committerAnders Carlsson <andersca@mac.com>2010-11-09 05:25:47 +0000
commit3d155e683a74d3783362ef1865be91544eb8a9fc (patch)
treed1078787b96e6ed3da422c642919a2b7aeac3c52 /lib/CodeGen/CGRecordLayout.h
parentb87b29ec2ae449686a745c257e577b7158d8d4aa (diff)
Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first step towards fixing PR6995.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRecordLayout.h')
-rw-r--r--lib/CodeGen/CGRecordLayout.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/CodeGen/CGRecordLayout.h b/lib/CodeGen/CGRecordLayout.h
index 9b4e9f86c6..dd10024dd4 100644
--- a/lib/CodeGen/CGRecordLayout.h
+++ b/lib/CodeGen/CGRecordLayout.h
@@ -172,9 +172,13 @@ class CGRecordLayout {
void operator=(const CGRecordLayout&); // DO NOT IMPLEMENT
private:
- /// The LLVMType corresponding to this record layout.
+ /// The LLVM type corresponding to this record layout.
const llvm::Type *LLVMType;
+ /// The LLVM type for the non-virtual part of this record layout, used for
+ /// laying out the record as a base.
+ const llvm::Type *BaseLLVMType;
+
/// Map from (non-bit-field) struct field to the corresponding llvm struct
/// type field no. This info is populated by record builder.
llvm::DenseMap<const FieldDecl *, unsigned> FieldInfo;
@@ -192,14 +196,20 @@ private:
bool IsZeroInitializable : 1;
public:
- CGRecordLayout(const llvm::Type *T, bool IsZeroInitializable)
- : LLVMType(T), IsZeroInitializable(IsZeroInitializable) {}
+ CGRecordLayout(const llvm::Type *LLVMType, const llvm::Type *BaseLLVMType,
+ bool IsZeroInitializable)
+ : LLVMType(LLVMType), BaseLLVMType(BaseLLVMType),
+ IsZeroInitializable(IsZeroInitializable) {}
/// \brief Return the LLVM type associated with this record.
const llvm::Type *getLLVMType() const {
return LLVMType;
}
+ const llvm::Type *getBaseLLVMType() const {
+ return BaseLLVMType;
+ }
+
/// \brief Check whether this struct can be C++ zero-initialized
/// with a zeroinitializer.
bool isZeroInitializable() const {