MS ABI: Don't ICE for pointers to pointers to members of incomplete classes
CodeGen would try to come up with an LLVM IR type for a pointer to member type on the way to forming an LLVM IR type for a pointer to pointer to member type. However, if the pointer to member representation has not been locked in yet, we would not be able to come up with a pointer to member IR type. In these cases, make the pointer to member type an incomplete type. This will make the pointer to pointer to member type a pointer to an incomplete type. If the class eventually obtains an inheritance model, we will make the pointer to member type represent the actual inheritance model. Differential Revision: http://reviews.llvm.org/D5373 llvm-svn: 218084
This commit is contained in:
@@ -79,6 +79,17 @@ CodeGenFunction::~CodeGenFunction() {
|
||||
}
|
||||
}
|
||||
|
||||
LValue CodeGenFunction::MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T) {
|
||||
CharUnits Alignment;
|
||||
if (CGM.getCXXABI().isTypeInfoCalculable(T)) {
|
||||
Alignment = getContext().getTypeAlignInChars(T);
|
||||
unsigned MaxAlign = getContext().getLangOpts().MaxTypeAlign;
|
||||
if (MaxAlign && Alignment.getQuantity() > MaxAlign &&
|
||||
!getContext().isAlignmentRequired(T))
|
||||
Alignment = CharUnits::fromQuantity(MaxAlign);
|
||||
}
|
||||
return LValue::MakeAddr(V, T, Alignment, getContext(), CGM.getTBAAInfo(T));
|
||||
}
|
||||
|
||||
llvm::Type *CodeGenFunction::ConvertTypeForMem(QualType T) {
|
||||
return CGM.getTypes().ConvertTypeForMem(T);
|
||||
|
||||
Reference in New Issue
Block a user