diff options
| author | Anders Carlsson <andersca@mac.com> | 2010-11-24 19:57:04 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2010-11-24 19:57:04 +0000 |
| commit | 6277615cbb1cda917dd8815a611fa1146e172af9 (patch) | |
| tree | 63f0b4df65daa5e675703fec158fb2508fa278f9 /clang/lib/CodeGen | |
| parent | c5bcaa373b83f2262bcb5b6243185a1a455c3043 (diff) | |
| download | bcm5719-llvm-6277615cbb1cda917dd8815a611fa1146e172af9.tar.gz bcm5719-llvm-6277615cbb1cda917dd8815a611fa1146e172af9.zip | |
Simplify code.
llvm-svn: 120109
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGRecordLayoutBuilder.cpp | 14 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 8 |
2 files changed, 2 insertions, 20 deletions
diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp index ce42a6aaaac..f846fca5069 100644 --- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -140,9 +140,6 @@ private: unsigned getTypeAlignment(const llvm::Type *Ty) const; - /// getCGRecordLayout - Return the CGRecordLayout for the given record. - const CGRecordLayout &getCGRecordLayout(const CXXRecordDecl *RD); - /// CheckZeroInitializable - Check if the given type contains a pointer /// to data member. void CheckZeroInitializable(QualType T); @@ -689,15 +686,6 @@ unsigned CGRecordLayoutBuilder::getTypeAlignment(const llvm::Type *Ty) const { return Types.getTargetData().getABITypeAlignment(Ty); } -const CGRecordLayout & -CGRecordLayoutBuilder::getCGRecordLayout(const CXXRecordDecl *RD) { - // FIXME: It would be better if there was a way to explicitly compute the - // record layout instead of converting to a type. - Types.ConvertTagDeclType(RD); - - return Types.getCGRecordLayout(RD); -} - void CGRecordLayoutBuilder::CheckZeroInitializable(QualType T) { // This record already contains a member pointer. if (!IsZeroInitializable) @@ -723,7 +711,7 @@ void CGRecordLayoutBuilder::CheckZeroInitializable(const CXXRecordDecl *RD) { if (!IsZeroInitializable) return; - const CGRecordLayout &Layout = getCGRecordLayout(RD); + const CGRecordLayout &Layout = Types.getCGRecordLayout(RD); if (!Layout.isZeroInitializable()) IsZeroInitializable = false; } diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index ea7d18f0ca0..fb1a6d8f13d 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -524,11 +524,5 @@ bool CodeGenTypes::isZeroInitializable(QualType T) { } bool CodeGenTypes::isZeroInitializable(const CXXRecordDecl *RD) { - - // FIXME: It would be better if there was a way to explicitly compute the - // record layout instead of converting to a type. - ConvertTagDeclType(RD); - - const CGRecordLayout &Layout = getCGRecordLayout(RD); - return Layout.isZeroInitializable(); + return getCGRecordLayout(RD).isZeroInitializable(); } |

