[PATCH] D39438: [analyzer] Diagnose stack leaks via block captures

2017-10-30 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added subscribers: szepet, xazax.hun. This diff extends StackAddrEscapeChecker to catch stack addr leaks via block captures if the block is executed asynchronously. Test plan: make check-all Repository: rL LLVM https://reviews.llvm.org/D39438 Files:

[PATCH] D39174: [analyzer] Fix handling of labels in getLValueElement

2017-10-23 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316399: [analyzer] Fix handling of labels in getLValueElement (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D39174?vs=119808=119972#toc Repository: rL LLVM

[PATCH] D39174: [analyzer] Fix handling of labels getLValueElement

2017-10-22 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added subscribers: szepet, xazax.hun. In getLValueElement Base may represent the address of a label (as in the newly-added test case), in this case it's not a loc::MemRegionVal and Base.castAs() triggers an assert. Test plan: make check-all Repository:

[PATCH] D38859: [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

2017-10-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315665: [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting… (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D38859?vs=118869=118881#toc Repository: rL

[PATCH] D38859: [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

2017-10-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 118869. alexshap added a comment. Update the wording Repository: rL LLVM https://reviews.llvm.org/D38859 Files: utils/perf-training/CMakeLists.txt Index: utils/perf-training/CMakeLists.txt

[PATCH] D38859: [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

2017-10-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 118868. Repository: rL LLVM https://reviews.llvm.org/D38859 Files: utils/perf-training/CMakeLists.txt Index: utils/perf-training/CMakeLists.txt === --- utils/perf-training/CMakeLists.txt

[PATCH] D38859: [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

2017-10-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. yeah, i agree, this is not a good idea. My thoughts were different - right now it's not particularly convenient that one has to specify LLVM_PROFDATA when it's not actually used by the build. Maybe we can create the target "generate-profdata" only if LLVM_PROFDATA is

[PATCH] D38859: [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

2017-10-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: mgorny. At the moment if LLVM_BUILD_INSTRUMENTED is set to True one has to set LLVM_PROFTDATA even if it's not necessary (because of message(FATAL_ERROR ...)). Building instrumented Clang is useful even if one doesn't plan to use the

[PATCH] D38270: [clang] Add getUnsignedPointerDiffType method

2017-09-28 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314470: [clang] Add getUnsignedPointerDiffType method (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D38270?vs=117061=117075#toc Repository: rL LLVM

[PATCH] D38270: [clang] Add getUnsignedPointerDiffType method

2017-09-28 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 117061. alexshap added a comment. Add positive tests Repository: rL LLVM https://reviews.llvm.org/D38270 Files: include/clang/AST/ASTContext.h include/clang/Basic/TargetInfo.h lib/AST/ASTContext.cpp lib/Analysis/PrintfFormatString.cpp

[PATCH] D38270: [clang] Add getUnsignedPointerDiffType method

2017-09-27 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 116894. alexshap added a comment. Address the comments Repository: rL LLVM https://reviews.llvm.org/D38270 Files: include/clang/AST/ASTContext.h include/clang/Basic/TargetInfo.h lib/AST/ASTContext.cpp lib/Analysis/PrintfFormatString.cpp

[PATCH] D38270: [clang] Add getUnsignedPointerDiffType method

2017-09-26 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 116635. alexshap added a comment. fix typo Repository: rL LLVM https://reviews.llvm.org/D38270 Files: include/clang/AST/ASTContext.h include/clang/Basic/TargetInfo.h lib/AST/ASTContext.cpp Index: lib/AST/ASTContext.cpp

[PATCH] D38270: [clang] Add getUnsignedPointerDiffType method

2017-09-26 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. C11 standard refers to the unsigned counterpart of the type ptrdiff_t in the paragraph 7.19.6 where it defines the format specifier %tu. In Clang (in PrintfFormatString.cpp, lines 508-510) there is a FIXME for this case, in particular, right now Clang doesn't

[PATCH] D38214: [analyzer] Fix crash on modeling of pointer arithmetic

2017-09-25 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314141: [analyzer] Fix crash on modeling of pointer arithmetic (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D38214?vs=116455=116590#toc Repository: rL LLVM

[PATCH] D38214: [analyzer] Fix crash on modeling of pointer arithmetic

2017-09-25 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: xazax.hun. This patch attempts to fix analyzer's crash on the newly added test case (see also https://bugs.llvm.org/show_bug.cgi?id=34374). Pointer subtraction appears to be modeled incorrectly in the following example: char* p;

[PATCH] D38151: [clang] Fix isExternC matcher docs

2017-09-22 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314022: [clang] Fix isExternC matcher docs (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D38151?vs=116251=116386#toc Repository: rL LLVM https://reviews.llvm.org/D38151

[PATCH] D38159: [clang] Fix printf fixit for objc specific types

2017-09-22 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314011: [clang] Fix printf fixit for objc specific types (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D38159?vs=116288=116380#toc Repository: rL LLVM

[PATCH] D38159: [clang] Fix printf fixit for objc specific types

2017-09-21 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Let's take a look at the following example: for the triple thumbv7-apple-ios8.0.0 ssize_t is long and size_t is unsigned long, while NSInteger is int and NSUinteger is unsigned int. Following

[PATCH] D38151: [clang] Fix isExternC matcher docs

2017-09-21 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: klimek. The wording in the documentation for the matcher isExternC appears to be misleading since this matcher is applicable to functions and variables as well. This diff changes the comment regenerates the html file. Repository: rL

[PATCH] D37120: [analyzer] Fix modeling arithmetic

2017-08-28 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311935: [analyzer] Fix crash in modeling arithmetic (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D37120?vs=112784=112967#toc Repository: rL LLVM

[PATCH] D37120: [analyzer] Fix modeling arithmetic

2017-08-28 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. updated the patch per suggestion by @NoQ Repository: rL LLVM https://reviews.llvm.org/D37120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D37120: [analyzer] Fix modeling arithmetic

2017-08-26 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 112784. alexshap added a comment. Return UnknownVal for non-comparison operations. Add FIXME (improve modeling of "pointers as integers"). Repository: rL LLVM https://reviews.llvm.org/D37120 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp

[PATCH] D37120: [analyzer] Fix modeling arithmetic

2017-08-25 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:363 case nonloc::LocAsIntegerKind: return evalBinOpLL(state, op, lhsL, rhs.castAs().getLoc(), @NoQ , @dcoughlin while we

[PATCH] D37120: [analyzer] Fix modeling arithmetic

2017-08-25 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:371-373 +return makeSymExprValNN( +state, op, lhs.castAs(), +rhs.castAs(), resultTy); NoQ wrote: > For now this code would

[PATCH] D37120: [analyzer] Fix modeling arithmetic

2017-08-24 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: xazax.hun. This diff attempts to fix modeling of arithmetic expressions where pointers are treated as integers (i.e. via C-style / reinterpret casts). In particular, it resolves https://bugs.llvm.org/show_bug.cgi?id=34309 Test plan: make

[PATCH] D36075: [refactor] Initial support for refactoring action rules

2017-08-24 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. @arphaman The selection requirement is supposed to be orthogonal to AST matchers, not a replacement. It should be used when working with source selection in editors. I did mess around with moving over clang-reorder-fields using this kind of model and didn't see

[PATCH] D36564: [analyzer] Fix SimpleSValBuilder::simplifySVal

2017-08-24 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. @alexfh, thanks for letting me know, i will take a closer look at https://bugs.llvm.org/show_bug.cgi?id=34309 soon. Repository: rL LLVM https://reviews.llvm.org/D36564 ___ cfe-commits mailing list

[PATCH] D36851: [analyzer] Fix modeling of ctors

2017-08-18 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311182: [analyzer] Fix modeling of constructors (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D36851?vs=111622=111711#toc Repository: rL LLVM

[PATCH] D36075: [refactor] Initial support for refactoring action rules

2017-08-18 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: include/clang/Basic/DiagnosticOr.h:40 + /// diagnostic. + DiagnosticOr(PartialDiagnosticAt Diagnostic) : HasDiagnostic(true) { +new (getDiagnosticStorage()) PartialDiagnosticAt(std::move(Diagnostic)); explicit ?

[PATCH] D36851: [analyzer] Fix modeling of ctors

2017-08-18 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 111622. alexshap added a comment. Skip the default binding for empty bases. Repository: rL LLVM https://reviews.llvm.org/D36851 Files: lib/StaticAnalyzer/Core/RegionStore.cpp test/Analysis/ctor.mm Index: test/Analysis/ctor.mm

[PATCH] D36851: [analyzer] Fix modeling of ctors

2017-08-17 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. >One alternative we discussed was performing this logic in RegionStore instead and skipping the default binding there >if we saw that the base region was empty. What do you think of that approach? (We would have to be careful for exactly the reasons described in

[PATCH] D36851: [analyzer] Fix modeling of ctors

2017-08-17 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: xazax.hun. This diff attempts to fixe analyzer's crash (triggered assert) on the newly added test case. The assert being discussed is assert(!B.lookup(R, BindingKey::Direct)) in lib/StaticAnalyzer/Core/RegionStore.cpp, however the root

[PATCH] D36715: [clang] minor cleanup in clang/tooling/refactoring

2017-08-15 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310948: [clang] Code cleanup in clang/tooling (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D36715?vs=111078=111229#toc Repository: rL LLVM

[PATCH] D36715: [clang] minor cleanup in clang/tooling/refactoring

2017-08-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. 1. Add missing explicit. 2. Add missing std::move (return type is Expected but we return std::vector, so cast to && is necessary). Test plan: make check-all Repository: rL LLVM https://reviews.llvm.org/D36715 Files:

[PATCH] D36564: [analyzer] Fix SimpleSValBuilder::simplifySVal

2017-08-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310887: [analyzer] Fix SimpleSValBuilder::simplifySVal (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D36564?vs=110502=111073#toc Repository: rL LLVM

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-08-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:561 + // manager to handle these comparisons. + if (BinaryOperator::isComparisonOp(op) && + rhs.getSubKind() == nonloc::SymbolValKind) { some thoughts -

[PATCH] D36564: [analyzer] Fix SimpleSValBuilder::simplifySVal

2017-08-09 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: xazax.hun. This diff attempts to address a crash (triggered assert) on the newly-added test case. The assert being discussed is inside SValBuilder::evalBinOp if (Optional RV = rhs.getAs()) { // Support pointer arithmetic where

[PATCH] D35972: Add warning to clang-reorder-fields when reordering breaks member init list dependencies

2017-07-30 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. https://reviews.llvm.org/rL309505 plus I changed the code to emit this warning via DiagnosticEngine and updated the tests accordingly. Repository: rL LLVM https://reviews.llvm.org/D35972 ___ cfe-commits mailing list

[PATCH] D35972: Add warning to clang-reorder-fields when reordering breaks member init list dependencies

2017-07-30 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309505: [clang-reorder-fields] Emit warning when reordering breaks member init list… (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35972?vs=108812=108818#toc Repository:

[PATCH] D35972: Add warning to clang-reorder-fields when reordering breaks member init list dependencies

2017-07-29 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap accepted this revision. alexshap added a comment. This revision is now accepted and ready to land. LGTM, thanks! do you have commit access ? (if not i can commit this patch for you) https://reviews.llvm.org/D35972 ___ cfe-commits mailing

[PATCH] D35972: Add warning to clang-reorder-fields when reordering breaks member init list dependencies

2017-07-27 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: test/clang-reorder-fields/FieldDependencyWarning.cpp:3 + +#include + tests should not depend on STL (for good examples see how things are done in clang-tidy tests), so simply remove this include and define a small

[PATCH] D35961: [llvm] Update MachOObjectFile::exports interface

2017-07-27 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. This diff removes the second argument of the method MachOObjectFile::exports which was recently introduced in r308690. In all in-tree uses this argument is equal to "this", additionally without this argument the interface seems to be cleaner. Test plan: make

[PATCH] D35329: [clang-reorder-fields] Enable reordering for plain C structs

2017-07-20 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308678: [clang-tools-extra] Add support for plain C structs in clang-reorder-fields (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35329?vs=107143=107588#toc Repository:

[PATCH] D35652: [clang] Fix handling of "%zd" format specifier in scanf

2017-07-20 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308662: [clang] Fix handling of "%zd" in scanf (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35652?vs=107569=107574#toc Repository: rL LLVM

[PATCH] D35652: [clang] Fix handling of "%zd" format specifier in scanf

2017-07-20 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 107569. alexshap added a comment. Address comments Repository: rL LLVM https://reviews.llvm.org/D35652 Files: lib/Analysis/ScanfFormatString.cpp test/Sema/format-strings-fixit-ssize_t.c test/Sema/format-strings-scanf.c Index:

[PATCH] D35652: [clang] Fix handling of "%zd" format specifier in scanf

2017-07-19 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: test/Sema/format-strings-fixit-ssize_t.c:4 +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -std=c99 -fsyntax-only -pedantic -Wall -Werror %t +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -std=c99 -E -o - %t | FileCheck %s

[PATCH] D35652: [clang] Fix handling of "%zd" format specifier in scanf

2017-07-19 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. This is a follow-up for https://reviews.llvm.org/D35427 ScanfFormatString.cpp has the same issue (incorrect handling of the specifiers for ssize_t) and this diff fixes it and adds tests. Test plan: make check-all Repository: rL LLVM

[PATCH] D35329: [clang-reorder-fields] Enable reordering for plain C structs

2017-07-18 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 107143. alexshap added a comment. update the comments Repository: rL LLVM https://reviews.llvm.org/D35329 Files: clang-reorder-fields/ReorderFieldsAction.cpp test/clang-reorder-fields/PlainCStructFieldsOrder.c Index:

[PATCH] D35329: [clang-reorder-fields] Enable reordering for plain C structs

2017-07-18 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. ping Repository: rL LLVM https://reviews.llvm.org/D35329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35427: [clang] Fix handling of "%zd" format specifier

2017-07-15 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. @chapuni - many thanks! Repository: rL LLVM https://reviews.llvm.org/D35427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35427: [clang] Fix handling of "%zd" format specifier

2017-07-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308067: [clang] Fix handling of "%zd" format specifier (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35427?vs=106694=106726#toc Repository: rL LLVM

[PATCH] D35427: [clang] Fix handling of "%zd" format specifier

2017-07-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 106694. alexshap added a comment. Address comments Repository: rL LLVM https://reviews.llvm.org/D35427 Files: lib/Analysis/PrintfFormatString.cpp test/FixIt/format.m Index: test/FixIt/format.m

[PATCH] D35427: [clang] Fix handling of "%zd" format specifier

2017-07-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. This diff addresses FIXME in lib/Analysis/PrintfFormatString.cpp and makes Clang warn on incorrect using of "%zd" format specifier. Test plan: make check-all Repository: rL LLVM https://reviews.llvm.org/D35427 Files: lib/Analysis/PrintfFormatString.cpp

[PATCH] D35378: [clang] Add getSignedSizeType method

2017-07-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308037: [clang] Add getSignedSizeType method (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35378?vs=106496=106662#toc Repository: rL LLVM

[PATCH] D35378: [clang] Add getSignedSizeType method

2017-07-13 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 106496. alexshap added a comment. make comments consistent Repository: rL LLVM https://reviews.llvm.org/D35378 Files: include/clang/AST/ASTContext.h include/clang/Basic/TargetInfo.h lib/AST/ASTContext.cpp Index: lib/AST/ASTContext.cpp

[PATCH] D35378: [clang] Add getSignedSizeType method

2017-07-13 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. C11 standard refers to the signed counterpart of the size_t type in the paragraph 7.21.6.1 where it defines d, i, o, u, x, or x conversion specifiers (in printf format string). In Clang there is a FIXME (in lib/Analysis/PrintfFormatString.cpp) for this case (which

[PATCH] D35329: [clang-reorder-fields] Enable reordering for plain C structs

2017-07-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. This diff adds support for reordering fields in structs when the code compiles as plain C, in particular we switch to using RecordDecl instead of CXXRecordDecl where it's appropriate. Test plan: make check-all Repository: rL LLVM

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307604: [analyzer] Start fixing modeling of bool based types (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35041?vs=105597=105947#toc Repository: rL LLVM

[PATCH] D35216: [analyzer] Escape symbols when creating std::initializer_list.

2017-07-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:810 +public: + CollectReachableSymbolsCallback(ProgramStateRef State) {} + const InvalidatedSymbols () const { return Symbols; } explicit ? https://reviews.llvm.org/D35216

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. ping Repository: rL LLVM https://reviews.llvm.org/D35041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-07 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 105597. Repository: rL LLVM https://reviews.llvm.org/D35041 Files: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/enum.cpp Index: test/Analysis/enum.cpp

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 105562. alexshap added a comment. Add a test where SimpleSValBuilder::evalCastFromNonLoc is called and we hit the line unsigned castSize = Context.getIntWidth(castTy); Repository: rL LLVM https://reviews.llvm.org/D35041 Files:

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 105524. alexshap added a comment. Add a test where evalCastFromLoc is called and the line unsigned BitWidth = Context.getIntWidth(castTy); is hit. I am planning to update this patch once again with a proper test where the path inside evalCastFromNonLoc is

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. >> In https://reviews.llvm.org/D35041#801073, @alexshap wrote: >> evalCastFromNonLoc is actually called there (and that's how i ran into this >> issue) because of (a bit unexpected to me) ImplicitCastExpr 'LValueToRValue' >> inside switch > > Yeah, but the NonLoc

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. thanks, 1. evalCastFromNonLoc is actually called there (and that's how i ran into this issue) because of (a bit unexpected to me) ImplicitCastExpr 'LValueToRValue' inside switch: F3629685: Screen Shot 2017-07-06 at 11.01.39 AM.png

[PATCH] D35041: [analyzer] Fix modeling bool-based types

2017-07-05 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added a subscriber: xazax.hun. This is a follow up for one of the previous diffs https://reviews.llvm.org/D32328. getTypeSize and with getIntWidth are not equivalent for bool (see https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l08444), this

[PATCH] D34696: [refactor] Move the core of clang-rename to lib/Tooling/Refactoring

2017-06-29 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: tools/extra/clang-rename/tool/ClangRename.cpp:167 FindingAction.getUSRList(); const std::vector = FindingAction.getUSRSpellings(); if (PrintName) { 1. nit: this line caught my eye (not directly related to

[PATCH] D34496: [clang] Fix printf check for CFIndex

2017-06-26 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306343: [clang] Enable printf check for CFIndex (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D34496?vs=103536=104038#toc Repository: rL LLVM

[PATCH] D34496: [clang] Fix printf check for CFIndex

2017-06-22 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 103536. alexshap added a comment. update the tests Repository: rL LLVM https://reviews.llvm.org/D34496 Files: lib/Sema/SemaChecking.cpp test/FixIt/fixit-format-darwin.m test/FixIt/format-darwin.m Index: test/FixIt/format-darwin.m

[PATCH] D34496: [clang] Fix printf check for CFIndex

2017-06-22 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap planned changes to this revision. alexshap added a comment. ignore this diff for now, i will update it soon. Repository: rL LLVM https://reviews.llvm.org/D34496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-20 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305845: [clang] Fix format specifiers fixits for nested macros (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D34268?vs=103093=103262#toc Repository: rL LLVM

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-19 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 103093. alexshap added a comment. update, rerun the tests Repository: rL LLVM https://reviews.llvm.org/D34268 Files: include/clang/Edit/EditedSource.h lib/Edit/EditedSource.cpp test/FixIt/fixit-format-darwin.m Index:

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-19 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap planned changes to this revision. alexshap marked an inline comment as done. alexshap added a comment. probably we don't need to keep the entire expansion stack in MacroArgUse (i was doing that because it was easier to understand what's going on). I will update this diff soon.

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-19 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap marked 3 inline comments as done. alexshap added inline comments. Comment at: lib/Edit/EditedSource.cpp:80 + return ArgUse.Identifier == U.Identifier && + std::tie(ArgUse.ExpansionStack, ArgUse.Use) != +

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-19 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 103090. alexshap added a comment. Address code review comments Repository: rL LLVM https://reviews.llvm.org/D34268 Files: include/clang/Edit/EditedSource.h lib/Edit/EditedSource.cpp test/FixIt/fixit-format-darwin.m Index:

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-17 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. Ping Repository: rL LLVM https://reviews.llvm.org/D34268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-15 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 102781. alexshap added a comment. minor update Repository: rL LLVM https://reviews.llvm.org/D34268 Files: include/clang/Edit/EditedSource.h lib/Edit/EditedSource.cpp test/FixIt/fixit-format-darwin.m Index: test/FixIt/fixit-format-darwin.m

[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

2017-06-15 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. ExpansionLoc was previously calculated incorrectly in the case of nested macros expansions. In this diff we build the stack of expansions where the last one is the actual expansion (in the source code) which should be used for grouping together the edits. The

[PATCH] D34066: [clang] Cleanup fixit.c

2017-06-09 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305124: [clang] Cleanup fixit.c (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D34066?vs=102076=102079#toc Repository: rL LLVM https://reviews.llvm.org/D34066 Files:

[PATCH] D34066: [clang] Cleanup fixit.c

2017-06-09 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. This diff removes temporary file t2 in fixit.c and updates the test command accordingly. NFC. Repository: rL LLVM https://reviews.llvm.org/D34066 Files: fixit.c Index: fixit.c === ---

[PATCH] D33976: [clang] Fix format specifiers fixits

2017-06-08 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305018: [clang] Fix format specifiers fixits (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D33976?vs=101962=101964#toc Repository: rL LLVM

[PATCH] D33976: [clang] Fix format specifiers fixits

2017-06-08 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 101962. alexshap added a comment. Address comments Repository: rL LLVM https://reviews.llvm.org/D33976 Files: include/clang/Edit/EditedSource.h lib/Edit/EditedSource.cpp test/FixIt/fixit-format-darwin.m Index: test/FixIt/fixit-format-darwin.m

[PATCH] D33976: [clang] Fix format specifiers fixits

2017-06-08 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. @mehdi_amini , thanks, i see, regarding the "opposite issue" - probably an example / test case would be helpful, that looks like a separate issue. Thanks for adding @ahatanak and @arphaman, that would be wonderful if smb could look at this diff (which, besides the fix,

[PATCH] D33976: [clang] Fix format specifiers fixits

2017-06-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. This diff fixes printf "fixits" in the case when there is a wrapping macro and the format string needs multiple replacements. In the presence of a macro there was an extra logic in EditedSource.cpp to handle multiple uses of the same macro argument (see the old

[PATCH] D33470: [clang-tidy] Add misc-default-numerics

2017-05-25 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: clang-tidy/misc/DefaultNumericsCheck.h:20 +/// This check flags usages of ``std::numeric_limits::{min,max}()`` for +/// unspecialized types. It is dangerous because it returns T(), which might is +/// rarely minimum or maximum for this

[PATCH] D33061: [tooling] RefactoringCallbacks code cleanup

2017-05-11 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL302855: [tooling] RefactoringCallbacks code cleanup (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D33061?vs=98509=98704#toc Repository: rL LLVM

[PATCH] D33061: [tooling] RefactoringCallbacks code cleanup

2017-05-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. alexshap created this object with visibility "All Users". 1. Add missing "explicit" for single argument constructors 2. Add missing std::move in ReplaceNodeWithTemplate constructor and switch to pass-by-value idiom Test plan: make check-clang Repository: rL

[PATCH] D32328: [analyzer] Fix assert in ExprEngine::processSwitch

2017-04-20 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300936: [analyzer] Fix assert in ExprEngine::processSwitch (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D32328?vs=96060=96070#toc Repository: rL LLVM

[PATCH] D32328: [analyzer] Fix assert in ExprEngine::processSwitch

2017-04-20 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. Thanks, i do. Repository: rL LLVM https://reviews.llvm.org/D32328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32112: [clang] Register isConstexpr matcher

2017-04-16 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300427: [clang] Register isConstexpr matcher (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D32112?vs=95385=95411#toc Repository: rL LLVM https://reviews.llvm.org/D32112

[PATCH] D32112: [clang] Register isConstexpr matcher

2017-04-15 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. alexshap created this object with visibility "All Users". I was working on some analyzer / clang-tidy code and noticed that isConstexpr was not available in clang-query. This diff registers this matcher. F3226452: Screen Shot 2017-04-15 at 4.21.23 PM.png

[PATCH] D32063: [clang-move] cleanup: create ClangMoveActionFactory on the stack

2017-04-14 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300356: [clang-move] Create ClangMoveActionFactory on stack (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D32063?vs=95233=95326#toc Repository: rL LLVM

[PATCH] D32063: [clang-move] cleanup: create ClangMoveActionFactory on the stack

2017-04-13 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. alexshap created this object with visibility "All Users". This diff removes unnecessary using of unique_ptr with ClangMoveActionFactory (pico cleanup). NFC Repository: rL LLVM https://reviews.llvm.org/D32063 Files: tool/ClangMoveMain.cpp Index:

[PATCH] D31982: [analyzer] Improve suppression for inlined defensive checks when operator& is involved.

2017-04-12 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:965 + +// Performing operator `&' on an lvalue expression is essentially a no-op. +// Then, if we are taking addresses of fields or elements, these are also

[PATCH] D31840: [analyzer] Fix crash on access to property

2017-04-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 94713. alexshap added a comment. 1. update the patch following NoQ@ suggestion 2. rerun the tests: make check-all - they are green Repository: rL LLVM https://reviews.llvm.org/D31840 Files: lib/StaticAnalyzer/Core/CallEvent.cpp

[PATCH] D31840: [analyzer] Fix crash on access to property

2017-04-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. alexshap created this object with visibility "All Users". Preliminary context about unions: at the moment for unions the static analyzer creates default bindings (as a compoundVal). If a union has only one field x which is initialized to zero this is handled as

[PATCH] D31492: Add `replace` interface with range in AtomicChange.

2017-03-30 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. to avoid misunderstanding - are the tools like clang-rename, change-namespace and clang-reorder-fields supposed to use AtomicChange (via the methods insert, replace etc) ? (i am asking just to make sure i understand correctly the intentions behind AtomicChange

[PATCH] D28218: Small optimizations for SourceManager::getFileID()

2017-03-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/Basic/SourceManager.cpp:843 if (E.getOffset() <= SLocOffset) { FileID Res = FileID::get(-int(I) - 2); not particularly important (and unrelated to your changes) - nit - s /C-style cast / static_cast

[PATCH] D27054: Introducing clang::tooling::AtomicChange for refactoring tools.

2017-02-28 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: include/clang/Tooling/Refactoring/AtomicChange.h:59 + /// \brief Returns the path of the file containing this atomic change. + std::string getFilePath() const { return FilePath; } + ioeric wrote: > alexshap wrote: >

[PATCH] D27054: Introducing clang::tooling::AtomicChange for refactoring tools.

2017-02-28 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added inline comments. Comment at: lib/Tooling/Refactoring/AtomicChange.cpp:35 +RemovedHeaders(E.getRemovedHeaders()) { +std::copy(E.getReplacements().begin(), E.getReplacements().end(), + std::back_inserter(Replaces)); if i am

<    1   2   3   4   >