[PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-26 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki created this revision. danielmarjamaki added subscribers: cfe-commits, NoQ, zaks.anna, a.sidorin, xazax.hun. danielmarjamaki set the repository for this revision to rL LLVM. This patch fixes false positives for vardecls that are technically unreachable but they are needed. ```

[PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-30 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Sorry, missed this patch. I think it would good to add a test to make sure we do warn when the var decl has an initializer, since that will not be executed. void varDecl(int X) { switch (X) { int A = 12; // We do want a warning here, since the variable wil

[PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-10-03 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added a comment. In https://reviews.llvm.org/D24905#557573, @dcoughlin wrote: > Sorry, missed this patch. > > I think it would good to add a test to make sure we do warn when the var decl > has an initializer, since that will not be executed. > > void varDecl(int X) { > swi

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-26 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki updated this revision to Diff 72455. danielmarjamaki added a comment. Minor updates of testcase Repository: rL LLVM https://reviews.llvm.org/D24905 Files: lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp test/Analysis/unreachable-code-path.c Index: test/Analysis/un

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-27 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp:195 @@ +194,3 @@ +if (Optional S = I->getAs()) { + if (isa(S->getStmt())) +return S->getStmt(); Maybe I would prefer something like !isa which is a

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-28 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki removed rL LLVM as the repository for this revision. danielmarjamaki updated this revision to Diff 72775. danielmarjamaki added a comment. Use !isa. Suggestion by Gabor. https://reviews.llvm.org/D24905 Files: lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp test/Analys

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-28 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki marked an inline comment as done. Comment at: lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp:195 @@ +194,3 @@ +if (Optional S = I->getAs()) { + if (!isa(S->getStmt())) +return S->getStmt(); yes I agree. https://reviews.ll

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-28 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki marked an inline comment as done. danielmarjamaki added a comment. https://reviews.llvm.org/D24905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-28 Thread Gábor Horváth via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D24905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

Re: [PATCH] D24905: Fix unreachable code false positive, vardecl in switch

2016-09-28 Thread Daniel Marjamäki via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282574: [StaticAnalyzer] Fix false positives for vardecls that are technically… (authored by danielmarjamaki). Changed prior to commit: https://reviews.llvm.org/D24905?vs=72775&id=72793#toc Repository: