From c39211d2aef5b8ca2bc69c9fb81ca3dfb3711eb0 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 18 May 2010 03:47:15 +0000 Subject: Add CodeGenTypes::ContainsPointerToDataMember overload that takes a CXXRecordDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104011 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenTypes.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/CodeGenTypes.cpp') diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 034e8ef622..a46dc726a4 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -481,12 +481,7 @@ bool CodeGenTypes::ContainsPointerToDataMember(QualType T) { if (const RecordType *RT = T->getAs()) { const CXXRecordDecl *RD = cast(RT->getDecl()); - // 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.containsPointerToDataMember(); + return ContainsPointerToDataMember(RD); } if (const MemberPointerType *MPT = T->getAs()) @@ -494,3 +489,13 @@ bool CodeGenTypes::ContainsPointerToDataMember(QualType T) { return false; } + +bool CodeGenTypes::ContainsPointerToDataMember(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.containsPointerToDataMember(); +} -- cgit v1.2.3