r235682 - Replace getPointeeType()->isFunctionType with isMemberDataPointerType
David Majnemer
david.majnemer at gmail.com
Thu Apr 23 18:25:08 PDT 2015
Author: majnemer
Date: Thu Apr 23 20:25:08 2015
New Revision: 235682
URL: http://llvm.org/viewvc/llvm-project?rev=235682&view=rev
Log:
Replace getPointeeType()->isFunctionType with isMemberDataPointerType
Modified:
cfe/trunk/lib/AST/ItaniumCXXABI.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
cfe/trunk/lib/Sema/SemaCast.cpp
Modified: cfe/trunk/lib/AST/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumCXXABI.cpp?rev=235682&r1=235681&r2=235682&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumCXXABI.cpp Thu Apr 23 20:25:08 2015
@@ -106,7 +106,7 @@ public:
TargetInfo::IntType PtrDiff = Target.getPtrDiffType(0);
uint64_t Width = Target.getTypeWidth(PtrDiff);
unsigned Align = Target.getTypeAlign(PtrDiff);
- if (MPT->getPointeeType()->isFunctionType())
+ if (MPT->isMemberFunctionPointer())
Width = 2 * Width;
return std::make_pair(Width, Align);
}
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=235682&r1=235681&r2=235682&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Apr 23 20:25:08 2015
@@ -1879,7 +1879,7 @@ llvm::MDType *CGDebugInfo::CreateType(co
llvm::MDType *CGDebugInfo::CreateType(const MemberPointerType *Ty,
llvm::MDFile *U) {
llvm::MDType *ClassType = getOrCreateType(QualType(Ty->getClass(), 0), U);
- if (!Ty->getPointeeType()->isFunctionType())
+ if (Ty->isMemberDataPointerType())
return DBuilder.createMemberPointerType(
getOrCreateType(Ty->getPointeeType(), U), ClassType,
CGM.getContext().getTypeSize(Ty));
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=235682&r1=235681&r2=235682&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Thu Apr 23 20:25:08 2015
@@ -1421,8 +1421,7 @@ llvm::Constant *CodeGenModule::EmitNullC
return ::EmitNullConstant(*this, RD, /*complete object*/ true);
}
- assert(T->isMemberPointerType() && "Should only see member pointers here!");
- assert(!T->getAs<MemberPointerType>()->getPointeeType()->isFunctionType() &&
+ assert(T->isMemberDataPointerType() &&
"Should only see pointers to data members here!");
return getCXXABI().EmitNullMemberPointer(T->castAs<MemberPointerType>());
Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=235682&r1=235681&r2=235682&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Thu Apr 23 20:25:08 2015
@@ -865,7 +865,7 @@ bool ItaniumCXXABI::classifyReturnType(C
/// The Itanium ABI requires non-zero initialization only for data
/// member pointers, for which '0' is a valid offset.
bool ItaniumCXXABI::isZeroInitializable(const MemberPointerType *MPT) {
- return MPT->getPointeeType()->isFunctionType();
+ return MPT->isMemberFunctionPointer();
}
/// The Itanium ABI always places an offset to the complete object
Modified: cfe/trunk/lib/Sema/SemaCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCast.cpp?rev=235682&r1=235681&r2=235682&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCast.cpp Thu Apr 23 20:25:08 2015
@@ -1817,8 +1817,8 @@ static TryCastResult TryReinterpretCast(
// can be explicitly converted to an rvalue of type "pointer to member
// of Y of type T2" if T1 and T2 are both function types or both object
// types.
- if (DestMemPtr->getPointeeType()->isFunctionType() !=
- SrcMemPtr->getPointeeType()->isFunctionType())
+ if (DestMemPtr->isMemberFunctionPointer() !=
+ SrcMemPtr->isMemberFunctionPointer())
return TC_NotApplicable;
// C++ 5.2.10p2: The reinterpret_cast operator shall not cast away
More information about the cfe-commits
mailing list