Refix rewriting of an ivar access when it is

type-cast to its sub-class (radar 7575882).

llvm-svn: 94559
This commit is contained in:
Fariborz Jahanian 2010-01-26 18:28:51 +00:00
parent ed71d8d70b
commit f9e8c2b759
2 changed files with 2 additions and 15 deletions

View File

@ -1037,6 +1037,7 @@
356EF9B30C8F7DCA006650F5 /* Analysis */ = {
isa = PBXGroup;
children = (
DE67E70A0C020EC500F66BC5 /* SemaType.cpp */,
35544B840F5C7F9D00D92AA9 /* Path-Sensitive */,
3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */,
3507E4C30E27FE3800FB7B57 /* Checks */,
@ -1265,7 +1266,6 @@
BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */,
35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */,
1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */,
DE67E70A0C020EC500F66BC5 /* SemaType.cpp */,
1AE4EE3B103B89CA00888A23 /* TreeTransform.h */,
);
name = Sema;

View File

@ -1213,8 +1213,7 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV,
ObjCIvarDecl *D = IV->getDecl();
const Expr *BaseExpr = IV->getBase();
if (CurMethodDef) {
if (BaseExpr->getType()->isObjCObjectPointerType() &&
isa<DeclRefExpr>(BaseExpr)) {
if (BaseExpr->getType()->isObjCObjectPointerType()) {
ObjCInterfaceType *iFaceDecl =
dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
// lookup which class implements the instance variable.
@ -4308,18 +4307,6 @@ void RewriteObjC::RewriteCastExpr(CStyleCastExpr *CE) {
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;