diff options
author | John McCall <rjmccall@apple.com> | 2010-08-22 21:01:12 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-22 21:01:12 +0000 |
commit | f16aa103d3afd42fbca2ab346f191bf745cec092 (patch) | |
tree | af2fd36fb705f0d900afe40561c89341546459b6 /lib/CodeGen/CGRecordLayout.h | |
parent | b76495673a381d209410d78af9d969bb3ae0a95a (diff) | |
download | clang-f16aa103d3afd42fbca2ab346f191bf745cec092.tar.gz |
Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRecordLayout.h')
-rw-r--r-- | lib/CodeGen/CGRecordLayout.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/CGRecordLayout.h b/lib/CodeGen/CGRecordLayout.h index e95591e5cc..965fcc5201 100644 --- a/lib/CodeGen/CGRecordLayout.h +++ b/lib/CodeGen/CGRecordLayout.h @@ -174,20 +174,21 @@ private: /// Whether one of the fields in this record layout is a pointer to data /// member, or a struct that contains pointer to data member. - bool ContainsPointerToDataMember : 1; + bool IsZeroInitializable : 1; public: - CGRecordLayout(const llvm::Type *T, bool ContainsPointerToDataMember) - : LLVMType(T), ContainsPointerToDataMember(ContainsPointerToDataMember) {} + CGRecordLayout(const llvm::Type *T, bool IsZeroInitializable) + : LLVMType(T), IsZeroInitializable(IsZeroInitializable) {} /// \brief Return the LLVM type associated with this record. const llvm::Type *getLLVMType() const { return LLVMType; } - /// \brief Check whether this struct contains pointers to data members. - bool containsPointerToDataMember() const { - return ContainsPointerToDataMember; + /// \brief Check whether this struct can be C++ zero-initialized + /// with a zeroinitializer. + bool isZeroInitializable() const { + return IsZeroInitializable; } /// \brief Return llvm::StructType element number that corresponds to the |