forked from OSchip/llvm-project
Fix a regression caused by my rewriting of cast of ivar
access (was radar 7575882). llvm-svn: 94481
This commit is contained in:
parent
d5575f29f1
commit
7b99f27392
|
@ -4308,15 +4308,17 @@ void RewriteObjC::RewriteCastExpr(CStyleCastExpr *CE) {
|
|||
TypeAsString.c_str(), TypeAsString.size());
|
||||
return;
|
||||
}
|
||||
if (QT->isObjCObjectPointerType()) {
|
||||
QualType ptee = QT->getAs<ObjCObjectPointerType>()->getPointeeType();
|
||||
std::string TypeAsString = "(struct ";
|
||||
TypeAsString += ptee.getAsString();
|
||||
TypeAsString += "_IMPL *";
|
||||
TypeAsString += ")";
|
||||
ReplaceText(LocStart, endBuf-startBuf+1,
|
||||
TypeAsString.c_str(), TypeAsString.size());
|
||||
return;
|
||||
if (LangOpts.Microsoft && QT->isObjCObjectPointerType()) {
|
||||
if (isa<ObjCInterfaceType>(QT->getPointeeType())) {
|
||||
QualType ptee = QT->getAs<ObjCObjectPointerType>()->getPointeeType();
|
||||
std::string TypeAsString = "(struct ";
|
||||
TypeAsString += ptee.getAsString();
|
||||
TypeAsString += "_IMPL *";
|
||||
TypeAsString += ")";
|
||||
ReplaceText(LocStart, endBuf-startBuf+1,
|
||||
TypeAsString.c_str(), TypeAsString.size());
|
||||
return;
|
||||
}
|
||||
}
|
||||
// advance the location to startArgList.
|
||||
const char *argPtr = startBuf;
|
||||
|
|
|
@ -20,5 +20,11 @@
|
|||
}
|
||||
@end
|
||||
|
||||
void objc_assign_strongCast(id);
|
||||
void __CFAssignWithWriteBarrier(void **location, void *value) {
|
||||
objc_assign_strongCast((id)value);
|
||||
}
|
||||
|
||||
// CHECK-LP: ((struct G_IMPL *)arg)->ivar
|
||||
|
||||
// CHECK-LP: objc_assign_strongCast((id)value)
|
||||
|
|
Loading…
Reference in New Issue