[analyzer] Fix a regression in ObjCUnusedIVars checker.

We can no longer rely on children iterator to visit all the AST
tree children of an expression (OpaqueValueExpr has no children).

llvm-svn: 156870
This commit is contained in:
Anna Zaks 2012-05-15 22:31:56 +00:00
parent a1626369b6
commit 58d986c866
2 changed files with 30 additions and 0 deletions

View File

@ -47,6 +47,15 @@ static void Scan(IvarUsageMap& M, const Stmt *S) {
return;
}
if (const PseudoObjectExpr *POE = dyn_cast<PseudoObjectExpr>(S))
for (PseudoObjectExpr::const_semantics_iterator
i = POE->semantics_begin(), e = POE->semantics_end(); i != e; ++i) {
const Expr *sub = *i;
if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(sub))
sub = OVE->getSourceExpr();
Scan(M, sub);
}
for (Stmt::const_child_iterator I=S->child_begin(),E=S->child_end(); I!=E;++I)
Scan(M, *I);
}

View File

@ -108,3 +108,24 @@ int radar_7254495(RDar7254495 *a) {
@implementation RDar8481311
@end
@class NSString;
@interface Radar11059352_1 {
@private
NSString *_pathString;
}
@property (readonly, strong) NSString *pathString;
@end
@interface Radar11059352 {
@private
Radar11059352_1 *_workspacePath;
}
@end
@implementation Radar11059352
- (void)useWorkspace {
NSString *workspacePathString = _workspacePath.pathString;
}
@end