Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread Steven Wu via cfe-commits
This revision was automatically updated to reflect the committed changes. steven_wu marked 2 inline comments as done. Closed by commit rL263087: Fix false positives for for-loop-analysis warning (authored by steven_wu). Changed prior to commit: http://reviews.llvm.org/D17627?vs=50212=50221#toc

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread John McCall via cfe-commits
rjmccall added a comment. Thanks, LGTM. http://reviews.llvm.org/D17627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread Steven Wu via cfe-commits
steven_wu updated this revision to Diff 50212. steven_wu updated the summary for this revision. steven_wu added a comment. Update according to feedback. I agree that OVE should never be null as semantics of PseudoObjectExpr. http://reviews.llvm.org/D17627 Files: lib/Sema/SemaStmt.cpp

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread John McCall via cfe-commits
rjmccall added inline comments. Comment at: lib/Sema/SemaStmt.cpp:1448 @@ +1447,3 @@ +if (auto *OVE = dyn_cast(S)) { + // Look pass OVE for Decl. + if (Expr *E = OVE->getSourceExpr()) "Look past the OVE into the expression it binds."

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread Steven Wu via cfe-commits
steven_wu updated this revision to Diff 50186. steven_wu added a comment. Update the patch to address John's feedback. We shouldn't even checking ObjCSubscript but looking at the Semantics for PseudoObjectExpr only. http://reviews.llvm.org/D17627 Files: lib/Sema/SemaStmt.cpp

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread John McCall via cfe-commits
rjmccall added a comment. The right fix is probably at the PseudoObjectExpr level; you should probably be looking at the semantic expressions instead of the syntactic. http://reviews.llvm.org/D17627 ___ cfe-commits mailing list

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-09 Thread Steven Wu via cfe-commits
steven_wu added a comment. ping http://reviews.llvm.org/D17627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-03-01 Thread Steven Wu via cfe-commits
steven_wu updated this revision to Diff 49549. steven_wu added a comment. I did some more digging of the issue. It seems ObjCSubscriptRefExpr always rebuilds and hinds both base and key behind OpaqueValueExpr. See ObjCSubscriptOpBuilder::rebuildAndCaptureObject so it looks the AST generated is

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-02-26 Thread Steven Wu via cfe-commits
steven_wu added subscribers: doug.gregor, rjmccall. steven_wu added reviewers: rjmccall, doug.gregor. steven_wu added a comment. Looking through the subscript sounds fine but I would like to know if this is indeed the only case that is being ignored because of OpaqueValueExpr and if everything

Re: [PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-02-25 Thread Richard Trieu via cfe-commits
rtrieu added a comment. This seems rather strange. Usually, a OpaqueValueExpr will hold an expression that is held elsewhere in the AST. However, in this case, it appears that all the references to --i are all behind OpaqueValueExpr's, so they aren't processed. `-CStyleCastExpr 0x5675d30

[PATCH] D17627: Fix false positives for for-loop-analysis warning

2016-02-25 Thread Steven Wu via cfe-commits
steven_wu created this revision. steven_wu added reviewers: rtrieu, thakis. steven_wu added a subscriber: cfe-commits. -Wfor-loop-analysis was incorrectly warning about certain cases because the DeclMatcher is not looking pass OpaqueValueExpr. http://reviews.llvm.org/D17627 Files: