[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-14 Thread Dominic Chen via Phabricator via cfe-commits
ddcc created this revision. Generate more IntSymExpr constraints, perform SVal simplification for IntSymExpr and SymbolCast constraints, and create fully symbolic SymExprs https://reviews.llvm.org/D35450 Files: include/clang/Config/config.h.cmake include/clang/StaticAnalyzer/Checkers/SValE

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-15 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 106758. ddcc added a comment. Modify Z3RangeConstraintManager::fixAPSInt() and add Expr::isCommutativeOp() https://reviews.llvm.org/D35450 Files: include/clang/AST/Expr.h include/clang/Config/config.h.cmake include/clang/StaticAnalyzer/Checkers/SValExpla

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-15 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. Compared with https://reviews.llvm.org/D28953, this revision fixes the test failure with `PR3991.m` with RangeConstraintManager, and a few other failures with Z3ConstraintManager. However, there's one remaining test failure in `range_casts.c` that I'm not sure how to resol

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 106883. ddcc added a comment. Fix typo https://reviews.llvm.org/D35450 Files: include/clang/AST/Expr.h include/clang/Config/config.h.cmake include/clang/StaticAnalyzer/Checkers/SValExplainer.h include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintM

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. > Is diff 1 the original diff from https://reviews.llvm.org/D28953? It was ok > to reopen it, but the new revision is also fine. No, diff 1 is already different; it contains most of the bugfixes. I couldn't find any way to reopen the previous review, and `arc diff` wouldn'

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 106896. ddcc added a comment. Fix tests after typo fix https://reviews.llvm.org/D35450 Files: include/clang/AST/Expr.h include/clang/Config/config.h.cmake include/clang/StaticAnalyzer/Checkers/SValExplainer.h include/clang/StaticAnalyzer/Core/PathSensi

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. As an update, after fixing the typo and updating the tests, the assertion in `range_casts.c` is no longer triggered and everything seems fine now. https://reviews.llvm.org/D35450 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D35450: [analyzer] Support generating and reasoning over more symbolic constraint types

2017-07-18 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 107190. ddcc added a comment. Minor style fix https://reviews.llvm.org/D35450 Files: include/clang/AST/Expr.h include/clang/Config/config.h.cmake include/clang/StaticAnalyzer/Checkers/SValExplainer.h include/clang/StaticAnalyzer/Core/PathSensitive/Cons

[PATCH] D28954: [analyzer] Add support for symbolic float expressions

2017-07-19 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. As an aside, I think it'd be good to land https://reviews.llvm.org/D28954 and https://reviews.llvm.org/D28955 first, since they affect accuracy and precision of various analyzer parts that this depends on. > Here are some examples that should all be UNKNOWN (right?) but ar

[PATCH] D26061: [analyzer] Refactor and simplify SimpleConstraintManager

2017-02-18 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 89054. ddcc added a comment. Rebase, incorporate https://reviews.llvm.org/D22862 https://reviews.llvm.org/D26061 Files: include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h include/clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintMana

[PATCH] D28952: [analyzer] Add new Z3 constraint manager backend

2017-02-24 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. Sounds good, I will commit https://reviews.llvm.org/D26061 and split out the tests from this (https://reviews.llvm.org/D28952). https://reviews.llvm.org/D28952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D26061: [analyzer] Refactor and simplify SimpleConstraintManager

2017-02-24 Thread Dominic Chen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296242: [analyzer] Refactor and simplify SimpleConstraintManager (authored by ddcc). Changed prior to commit: https://reviews.llvm.org/D26061?vs=89054&id=89773#toc Repository: rL LLVM https://review

[PATCH] D28952: [analyzer] Add new Z3 constraint manager backend

2017-02-24 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 89777. ddcc added a comment. Drop tests, move to https://reviews.llvm.org/D30373 https://reviews.llvm.org/D28952 Files: CMakeLists.txt cmake/modules/FindZ3.cmake include/clang/Config/config.h.cmake include/clang/StaticAnalyzer/Core/Analyses.def inclu

[PATCH] D30373: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

2017-02-26 Thread Dominic Chen via Phabricator via cfe-commits
ddcc reopened this revision. ddcc added a comment. This revision is now accepted and ready to land. Looks like there were four latent test failures that had been masked due to the way they were written. Here's the new version. Repository: rL LLVM https://reviews.llvm.org/D30373 __

[PATCH] D30373: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

2017-02-27 Thread Dominic Chen via Phabricator via cfe-commits
ddcc reopened this revision. ddcc added a comment. This revision is now accepted and ready to land. It looks like there's some sort of pickling-related test failure when lit tries to fork, because it can't find the class `lit.TestingConfig.AnalyzerTest`: http://lab.llvm.org:8011/builders/llvm-cl

[PATCH] D30373: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

2017-03-01 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. With the first method, I'm not sure how to refer to the `AnalyzerTest` class defined in `lit.cfg` from `lit.local.cfg`. It doesn't seem to be in scope, so unless I store an instantiation in the `config` object, I don't think it's accessible. Repository: rL LLVM https:

[PATCH] D30373: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

2017-03-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc reopened this revision. ddcc added a comment. This revision is now accepted and ready to land. You're right about the failure being specific to Windows, I'll roll back to the original implementation in `lit.local.cfg` and just skip on Windows. Repository: rL LLVM https://reviews.llvm.or

[PATCH] D30373: [analyzer] NFC: Update test infrastructure to support multiple constraint managers

2017-03-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc reopened this revision. ddcc added a comment. This revision is now accepted and ready to land. Made a mistake with the last commit, I believe this should be fine now? Repository: rL LLVM https://reviews.llvm.org/D30373 ___ cfe-commits mailin

[PATCH] D28952: [analyzer] Add new Z3 constraint manager backend

2017-03-06 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. Thanks for your help! Let me know when the buildbot is ready for this to land. https://reviews.llvm.org/D28952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26955: Fix bitwidth for x87 extended-precision floating-point type

2016-11-28 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added inline comments. Comment at: lib/Basic/TargetInfo.cpp:229 switch (BitWidth) { - case 96: + case 80: if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended) bruno wrote: > The change makes sense but I believe there's some historical r

[PATCH] D26694: [analyzer] Drop explicit mention of range constraint solver

2016-12-01 Thread Dominic Chen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288372: [analyzer] Drop explicit mention of range constraint solver (authored by ddcc). Changed prior to commit: https://reviews.llvm.org/D26694?vs=78060&id=79924#toc Repository: rL LLVM https://rev

[PATCH] D26955: Fix bitwidth for x87 extended-precision floating-point type

2016-12-01 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 79996. ddcc added a comment. Change definition https://reviews.llvm.org/D26955 Files: lib/Basic/TargetInfo.cpp lib/Sema/SemaDeclAttr.cpp Index: lib/Sema/SemaDeclAttr.cpp === --- lib/Sema/Sem

[PATCH] D26691: [analyzer] Run clang-format and fix style

2016-12-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 80128. ddcc added a comment. Un-change comments, misc. changes https://reviews.llvm.org/D26691 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp lib/StaticAnalyzer/Core/SimpleConstraintManager.h

[PATCH] D26691: [analyzer] Run clang-format and fix style

2016-12-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).In

[PATCH] D26061: [analyzer] Refactor and simplify SimpleConstraintManager

2016-12-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 80129. ddcc added a comment. Rebase, move `assumeSymRel()` to RangedConstraintManager, make `assumeSymUnsupported` pure virtual in SimpleConstraintManager. https://reviews.llvm.org/D26061 Files: include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintMana

[PATCH] D27365: [analyzer] Print type for SymbolRegionValues when dumping to stream

2016-12-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc created this revision. ddcc added reviewers: NoQ, dcoughlin, zaks.anna. ddcc added a subscriber: cfe-commits. https://reviews.llvm.org/D27365 Files: lib/StaticAnalyzer/Core/SymbolManager.cpp test/Analysis/expr-inspection.c Index: test/Analysis/expr-inspection.c

[PATCH] D26691: [analyzer] Run clang-format and fix style

2016-12-02 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).In

[PATCH] D27365: [analyzer] Print type for SymbolRegionValues when dumping to stream

2016-12-03 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. Yeah, I had to implement implicit type promotion and conversion, because Z3 checks expression types pretty strictly. https://reviews.llvm.org/D27365 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org

[PATCH] D27365: [analyzer] Print type for SymbolRegionValues when dumping to stream

2016-12-05 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 80310. ddcc added a comment. Fix rebase https://reviews.llvm.org/D27365 Files: lib/StaticAnalyzer/Core/SymbolManager.cpp test/Analysis/expr-inspection.c Index: test/Analysis/expr-inspection.c ==

[PATCH] D27365: [analyzer] Print type for SymbolRegionValues when dumping to stream

2016-12-05 Thread Dominic Chen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288696: [analyzer] Print type for SymbolRegionValues when dumping to stream (authored by ddcc). Changed prior to commit: https://reviews.llvm.org/D27365?vs=80310&id=80311#toc Repository: rL LLVM htt

[PATCH] D26691: [analyzer] Run clang-format and fix style

2016-12-12 Thread Dominic Chen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL289511: [analyzer] Run clang-format and fix style (authored by ddcc). Changed prior to commit: https://reviews.llvm.org/D26691?vs=80128&id=81170#toc Repository: rL LLVM https://reviews.llvm.org/D266

[PATCH] D26061: [analyzer] Refactor and simplify SimpleConstraintManager

2016-12-12 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. How does this look now? https://reviews.llvm.org/D26061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28955: [analyzer] Enable support for symbolic extension/truncation

2017-05-05 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. @dcoughlin : ping https://reviews.llvm.org/D28955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28952: [analyzer] Add new Z3 constraint manager backend

2017-05-10 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. In https://reviews.llvm.org/D28952#750558, @iris wrote: > How can I make z3constraintmanager.cpp work in the command line?Or how to > make z3 work? You'll need a bleeding-edge build of Clang/LLVM, since this isn't available in any stable release yet. First, build or inst

[PATCH] D28953: [analyzer] Eliminate analyzer limitations on symbolic constraint generation

2017-05-10 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. It's been a while since I looked at the code, but I don't believe that all of the new constraints are necessarily unsupported by the current range constraint manager. Rather, they were just not being generated by the SimpleSValBuilder. The changes pass the testsuite for bo

[PATCH] D28953: [analyzer] Eliminate analyzer limitations on symbolic constraint generation

2017-05-10 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 98545. ddcc added a comment. Rebase https://reviews.llvm.org/D28953 Files: include/clang/StaticAnalyzer/Checkers/SValExplainer.h lib/StaticAnalyzer/Core/SValBuilder.cpp lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/bitwise-ops.c test/An

[PATCH] D28954: [analyzer] Add support for symbolic float expressions

2017-05-14 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. In https://reviews.llvm.org/D28954#754478, @lirhea wrote: > In https://reviews.llvm.org/D28954#714936, @ddcc wrote: > > > Rebase, update tests, fix bugs > > > Excuse me,I want to download full codes of this version,but I have no idea > how to do it,can you tell me? > And m

[PATCH] D28952: [analyzer] Add new Z3 constraint manager backend

2017-05-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. In https://reviews.llvm.org/D28952#757375, @iris wrote: > Thank you for helping me build clang with z3.I have already applied the above > updating.But now I have another question, when running clang with '-Xanalyzer > -analyzer-constraints=z3' there is always be a fatal er

[PATCH] D28953: [analyzer] Eliminate analyzer limitations on symbolic constraint generation

2017-05-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 99392. ddcc added a comment. Address SVal simplification from https://reviews.llvm.org/D31886 https://reviews.llvm.org/D28953 Files: include/clang/StaticAnalyzer/Checkers/SValExplainer.h lib/StaticAnalyzer/Core/SValBuilder.cpp lib/StaticAnalyzer/Core/Sim

[PATCH] D28953: [analyzer] Eliminate analyzer limitations on symbolic constraint generation

2017-05-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc added a comment. I've updated this revision to account for the recent SVal simplification commit by @NoQ, but now there is an exponential recursion problem that prevents testcase `PR24184.cpp` from terminating, due to an interaction between `Simplifier::VisitNonLocSymbolVal()` and `SValBui

[PATCH] D33308: [analyzer]: Improve test handling with multiple constraint managers

2017-05-17 Thread Dominic Chen via Phabricator via cfe-commits
ddcc created this revision. Modify the test infrastructure to properly handle tests that require z3, and merge together the output of all tests on success. This is required for https://reviews.llvm.org/D28954. https://reviews.llvm.org/D33308 Files: test/Analysis/analyzer_test.py Index: te

[PATCH] D28953: [analyzer] Eliminate analyzer limitations on symbolic constraint generation

2017-05-18 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 99521. ddcc added a comment. Fix typo in SymbolCast simplification https://reviews.llvm.org/D28953 Files: include/clang/StaticAnalyzer/Checkers/SValExplainer.h lib/StaticAnalyzer/Core/SValBuilder.cpp lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp lib/St

[PATCH] D28954: [analyzer] Add support for symbolic float expressions

2017-05-18 Thread Dominic Chen via Phabricator via cfe-commits
ddcc updated this revision to Diff 99522. ddcc added a comment. Herald added a subscriber: eraman. Rebase, avoid generating floating-point constraints if unsupported by constraint manager https://reviews.llvm.org/D28954 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td include/clang

<    1   2