Fix a regression caused by my rewriting of cast of ivar

access (was radar 7575882).

llvm-svn: 94481
This commit is contained in:
Fariborz Jahanian 2010-01-26 00:29:22 +00:00
parent d5575f29f1
commit 7b99f27392
2 changed files with 17 additions and 9 deletions

View File

@ -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;

View File

@ -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)