forked from OSchip/llvm-project
Replace getPointeeType()->isFunctionType with isMemberDataPointerType
llvm-svn: 235682
This commit is contained in:
parent
e154456d4a
commit
5fd33e0d1a
|
@ -106,7 +106,7 @@ public:
|
||||||
TargetInfo::IntType PtrDiff = Target.getPtrDiffType(0);
|
TargetInfo::IntType PtrDiff = Target.getPtrDiffType(0);
|
||||||
uint64_t Width = Target.getTypeWidth(PtrDiff);
|
uint64_t Width = Target.getTypeWidth(PtrDiff);
|
||||||
unsigned Align = Target.getTypeAlign(PtrDiff);
|
unsigned Align = Target.getTypeAlign(PtrDiff);
|
||||||
if (MPT->getPointeeType()->isFunctionType())
|
if (MPT->isMemberFunctionPointer())
|
||||||
Width = 2 * Width;
|
Width = 2 * Width;
|
||||||
return std::make_pair(Width, Align);
|
return std::make_pair(Width, Align);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1879,7 +1879,7 @@ llvm::MDType *CGDebugInfo::CreateType(const RValueReferenceType *Ty,
|
||||||
llvm::MDType *CGDebugInfo::CreateType(const MemberPointerType *Ty,
|
llvm::MDType *CGDebugInfo::CreateType(const MemberPointerType *Ty,
|
||||||
llvm::MDFile *U) {
|
llvm::MDFile *U) {
|
||||||
llvm::MDType *ClassType = getOrCreateType(QualType(Ty->getClass(), 0), U);
|
llvm::MDType *ClassType = getOrCreateType(QualType(Ty->getClass(), 0), U);
|
||||||
if (!Ty->getPointeeType()->isFunctionType())
|
if (Ty->isMemberDataPointerType())
|
||||||
return DBuilder.createMemberPointerType(
|
return DBuilder.createMemberPointerType(
|
||||||
getOrCreateType(Ty->getPointeeType(), U), ClassType,
|
getOrCreateType(Ty->getPointeeType(), U), ClassType,
|
||||||
CGM.getContext().getTypeSize(Ty));
|
CGM.getContext().getTypeSize(Ty));
|
||||||
|
|
|
@ -1421,8 +1421,7 @@ llvm::Constant *CodeGenModule::EmitNullConstant(QualType T) {
|
||||||
return ::EmitNullConstant(*this, RD, /*complete object*/ true);
|
return ::EmitNullConstant(*this, RD, /*complete object*/ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(T->isMemberPointerType() && "Should only see member pointers here!");
|
assert(T->isMemberDataPointerType() &&
|
||||||
assert(!T->getAs<MemberPointerType>()->getPointeeType()->isFunctionType() &&
|
|
||||||
"Should only see pointers to data members here!");
|
"Should only see pointers to data members here!");
|
||||||
|
|
||||||
return getCXXABI().EmitNullMemberPointer(T->castAs<MemberPointerType>());
|
return getCXXABI().EmitNullMemberPointer(T->castAs<MemberPointerType>());
|
||||||
|
|
|
@ -865,7 +865,7 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo &FI) const {
|
||||||
/// The Itanium ABI requires non-zero initialization only for data
|
/// The Itanium ABI requires non-zero initialization only for data
|
||||||
/// member pointers, for which '0' is a valid offset.
|
/// member pointers, for which '0' is a valid offset.
|
||||||
bool ItaniumCXXABI::isZeroInitializable(const MemberPointerType *MPT) {
|
bool ItaniumCXXABI::isZeroInitializable(const MemberPointerType *MPT) {
|
||||||
return MPT->getPointeeType()->isFunctionType();
|
return MPT->isMemberFunctionPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The Itanium ABI always places an offset to the complete object
|
/// The Itanium ABI always places an offset to the complete object
|
||||||
|
|
|
@ -1817,8 +1817,8 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
|
||||||
// can be explicitly converted to an rvalue of type "pointer to member
|
// 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
|
// of Y of type T2" if T1 and T2 are both function types or both object
|
||||||
// types.
|
// types.
|
||||||
if (DestMemPtr->getPointeeType()->isFunctionType() !=
|
if (DestMemPtr->isMemberFunctionPointer() !=
|
||||||
SrcMemPtr->getPointeeType()->isFunctionType())
|
SrcMemPtr->isMemberFunctionPointer())
|
||||||
return TC_NotApplicable;
|
return TC_NotApplicable;
|
||||||
|
|
||||||
// C++ 5.2.10p2: The reinterpret_cast operator shall not cast away
|
// C++ 5.2.10p2: The reinterpret_cast operator shall not cast away
|
||||||
|
|
Loading…
Reference in New Issue