baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:204
+ CheckerContext ) const {
+ const auto *ThisExpr = COCE->getArg(0);
+
baloghadamsoftware wrote:
> NoQ
baloghadamsoftware added inline comments.
Comment at: test/Analysis/Inputs/system-header-simulator-for-iterators.h:62
+ ForwardIterator2 first2, ForwardIterator2 last2);
+}
Maybe we should merge this file with the
baloghadamsoftware updated this revision to Diff 78527.
baloghadamsoftware added a comment.
Test updated to include test case where system headers are inlined.
https://reviews.llvm.org/D25660
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
baloghadamsoftware added a comment.
DO I have to apply your path over patch and update the diff?
https://reviews.llvm.org/D22374
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware marked 2 inline comments as done.
baloghadamsoftware added a comment.
In https://reviews.llvm.org/D25660#590778, @NoQ wrote:
> - Agree on the `evalAssume()` implementation (i'm still not quite
> understanding what the problem is here, see the new inline comments);
I think
baloghadamsoftware marked 10 inline comments as done.
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:209
+ CheckerContext ) const {
+ const auto *Func =
baloghadamsoftware updated this revision to Diff 78352.
baloghadamsoftware added a comment.
Updated according to comments.
https://reviews.llvm.org/D25660
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:204
+ CheckerContext ) const {
+ const auto *ThisExpr = COCE->getArg(0);
+
NoQ wrote:
> This code definitely
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:423
+
+void IteratorPastEndChecker::handleComparison(CheckerContext ,
+ const SVal ,
baloghadamsoftware
baloghadamsoftware marked an inline comment as done.
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:423
+
+void IteratorPastEndChecker::handleComparison(CheckerContext ,
+
baloghadamsoftware updated this revision to Diff 77033.
baloghadamsoftware added a comment.
Interim version, updated according to some of the comments.
https://reviews.llvm.org/D25660
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:423
+
+void IteratorPastEndChecker::handleComparison(CheckerContext ,
+ const SVal ,
NoQ wrote:
> a.sidorin
baloghadamsoftware added inline comments.
Comment at: test/Analysis/iterator-past-end.cpp:3
+
+template struct __iterator {
+ typedef __iterator iterator;
NoQ wrote:
> baloghadamsoftware wrote:
> > NoQ wrote:
> > > We should probably separate this
baloghadamsoftware added a comment.
In https://reviews.llvm.org/D22374#575579, @NoQ wrote:
> Ping!~ Did my idea sound completely wrong to you? :)
>
> Does https://reviews.llvm.org/D25660 depend on this patch? And/or did you
> find another workaround?
>
> upd.: I also thought that this deserves
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:195
+auto Param = State->getLValue(P, LCtx);
+auto Arg = State->getSVal(CE->getArg(idx++), LCtx->getParent());
+const auto *Pos = getIteratorPosition(State,
baloghadamsoftware updated this revision to Diff 75875.
baloghadamsoftware added a comment.
Updated according to the comments. Also fixed a bug and moved access check to
pre-call instead of post-call.
https://reviews.llvm.org/D25660
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
baloghadamsoftware added a comment.
In https://reviews.llvm.org/D22374#506098, @NoQ wrote:
> I guess i could post a patch-over-a-patch if what i'm expressing isn't clear.
I think this would be the best :-)
https://reviews.llvm.org/D22374
___
baloghadamsoftware added a comment.
In https://reviews.llvm.org/D22374#504855, @NoQ wrote:
> Hmm. I suggest:
>
> 1. Change this test's constructor so that it was no longer almost-trivial.
> Because it isn't significant for this test if the constructor is
> almost-trivial or not. The test would
baloghadamsoftware added a comment.
I agree with you. Do I have to modify the checker (in a separate patch), or
someone else can do it? I do not know how difficult it is to unpack the store
of a LazyCompoundVal (it probably has to be done recursively).
https://reviews.llvm.org/D22374
baloghadamsoftware added a comment.
Now I made a thorough check. Indeed, with the original version we get a warning
because Other.y is not initialized. CheckerManager::runCheckersForBind() is
called here during the default evaluation of the call. I tried to call the same
function in
baloghadamsoftware removed rL LLVM as the repository for this revision.
baloghadamsoftware updated this revision to Diff 64864.
baloghadamsoftware added a comment.
Bug path string fixed.
https://reviews.llvm.org/D19311
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
baloghadamsoftware added a comment.
Thx, I checked the output, but I do not understand why a simple string
concatenation fails in your test environment. It works on our build server
(Linux) with the latest master trunk.
Repository:
rL LLVM
https://reviews.llvm.org/D19311
baloghadamsoftware added a comment.
Do I use an non-portable way to concatenate strings? "Assuming rhs == *this"
becomes "0*this" for some strange reason. I tested it again with the latest
master branch and all tests are passing like earlier.
Repository:
rL LLVM
baloghadamsoftware added inline comments.
Comment at: test/Analysis/ctor.mm:177
@@ -176,3 +176,3 @@
Inner(const Inner )
-: x(Other.x), y(Other.y) // expected-warning {{undefined}}
+: x(Other.x), y(Other.y) // no-warning
{
a.sidorin
baloghadamsoftware marked 6 inline comments as done.
baloghadamsoftware added a comment.
https://reviews.llvm.org/D22374
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware updated this revision to Diff 64149.
baloghadamsoftware added a comment.
Revised version based on comments.
https://reviews.llvm.org/D22374
Files:
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
test/Analysis/ctor.mm
Index: test/Analysis/ctor.mm
baloghadamsoftware marked an inline comment as done.
baloghadamsoftware added a comment.
https://reviews.llvm.org/D19311
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware updated this revision to Diff 64135.
baloghadamsoftware added a comment.
Test updated.
https://reviews.llvm.org/D19311
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h
baloghadamsoftware added a comment.
I added tests for move assignment operators, but I could not find out any other
simple test case than memory leak. However memory leaks are currently only
detected by Unix.malloc for malloc. So I tried to replace strdup with malloc,
strlen and strcpy, but
baloghadamsoftware added inline comments.
Comment at: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:452
@@ -444,5 +451,3 @@
// inlining when reanalyzing an already inlined function.
- if (Visited.count(D)) {
-assert(isa(D) &&
- "We are only reanalyzing
baloghadamsoftware updated this revision to Diff 63207.
baloghadamsoftware added a comment.
Debug line removed.
http://reviews.llvm.org/D19311
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h
baloghadamsoftware marked 3 inline comments as done.
baloghadamsoftware added a comment.
http://reviews.llvm.org/D19311
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware updated this revision to Diff 63204.
baloghadamsoftware added a comment.
Issues fixed.
http://reviews.llvm.org/D19311
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h
baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: dcoughlin.
baloghadamsoftware added subscribers: cfe-commits, xazax.hun, o.gyorgy.
The strdup family was only partially handled in the original checker. As a
consequence it did not recognize leaks where a variable
baloghadamsoftware added a comment.
I see this one is accepted, but the prerequisite is not reviewed yet (after the
update). Without that this one should not be merged into the code because it
will not compile.
http://reviews.llvm.org/D18265
___
baloghadamsoftware added inline comments.
Comment at: clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp:69
@@ +68,3 @@
+void UnconventionalAssignOperatorCheck::check(const MatchFinder::MatchResult
) {
+ if (const auto *RetStmt = Result.Nodes.getNodeAs("returnStmt")) {
+
baloghadamsoftware updated this revision to Diff 54968.
baloghadamsoftware added a comment.
Initial comments added to the checker and tests are converted from
(DOS) to (Unix) format.
http://reviews.llvm.org/D19311
Files:
lib/StaticAnalyzer/Checkers/CMakeLists.txt
baloghadamsoftware added a comment.
I will run it, once we are approaching the final version. This one is more of a
question than a real patch.
http://reviews.llvm.org/D19357
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
baloghadamsoftware retitled this revision from "[clang-tidy] New: checker
misc-assign-operator-return" to "[clang-tidy] New: checker
misc-unconventional-assign-operator replacing misc-assign-operator-signature".
baloghadamsoftware updated this revision to Diff 54486.
baloghadamsoftware added a
baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: sbenza.
baloghadamsoftware added subscribers: cfe-commits, xazax.hun, o.gyorgy.
Herald added a subscriber: klimek.
Matcher proposed in the review of checker misc-assign-operator (name pending).
Its goal is to find the
baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: dcoughlin.
baloghadamsoftware added subscribers: cfe-commits, xazax.hun, o.gyorgy.
This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines
baloghadamsoftware added a comment.
misc-unconventional-assign-operator, misc-assign-operator-conventions,
misc-non-idiomatic-assign-operator or something else then?
http://reviews.llvm.org/D18265
___
cfe-commits mailing list
baloghadamsoftware added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
sbenza wrote:
>
baloghadamsoftware added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
sbenza wrote:
>
baloghadamsoftware added a comment.
And what about the final name?
http://reviews.llvm.org/D18265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
sbenza wrote:
> I
baloghadamsoftware added a comment.
In http://reviews.llvm.org/D18265#387078, @LegalizeAdulthood wrote:
> Please summarize this check in `docs/ReleaseNotes.rst`.
OK, I will do it after the name is decided.
http://reviews.llvm.org/D18265
___
baloghadamsoftware added a comment.
misc-unconventional-assign-operator?
http://reviews.llvm.org/D18265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware added a comment.
Actually, there was nothing wrong with assign operator signatures per se either
although the original name of the checker was AssignOperatorSignature. The only
change here is that it does not check the signature only anymore, but also the
body (if present).
baloghadamsoftware added a comment.
Unchainable is not enough: the original checker (which was extended) also
checks for parameters and other qualifiers such as const or virtual.
http://reviews.llvm.org/D18265
___
cfe-commits mailing list
baloghadamsoftware marked an inline comment as done.
Comment at: clang-tidy/misc/MiscTidyModule.cpp:54
@@ -55,1 +53,3 @@
+CheckFactories.registerCheck(
+"misc-assign-operator");
CheckFactories.registerCheck(
alexfh wrote:
> Check names usually
baloghadamsoftware added a comment.
Are there any other comments please?
http://reviews.llvm.org/D18243
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware marked an inline comment as done.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:75
@@ +74,3 @@
+static const char *const Messages[][2] = {
+{"ReturnType", "operator=() should return '%0&'"},
+{"ArgumentType", "operator=() should take
baloghadamsoftware updated this revision to Diff 51906.
baloghadamsoftware added a comment.
Requested fixes done (not related to the changes).
http://reviews.llvm.org/D18265
Files:
clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
clang-tidy/misc/AssignOperatorCheck.cpp
baloghadamsoftware added a comment.
Thank you for your comments, but they are not related to my changes. These
lines were present in the original file and I did not change them.
http://reviews.llvm.org/D18265
___
cfe-commits mailing list
baloghadamsoftware marked 9 inline comments as done.
Comment at: clang-tidy/misc/MisplacedWideningCastCheck.cpp:117
@@ +116,3 @@
+static llvm::SmallDenseMap createRelativeCharSizesMap() {
+ llvm::SmallDenseMap Result(6);
+ Result[BuiltinType::UChar] = 1;
baloghadamsoftware updated this revision to Diff 51633.
baloghadamsoftware added a comment.
Requested revision done.
http://reviews.llvm.org/D17987
Files:
clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp
clang-tidy/misc/MisplacedWideningCastCheck.cpp
baloghadamsoftware updated this revision to Diff 51554.
baloghadamsoftware added a comment.
Merged into misc-assign-operator-signature and thus renamed to
misc-assign-operator
http://reviews.llvm.org/D18265
Files:
clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
baloghadamsoftware updated this revision to Diff 51521.
baloghadamsoftware added a comment.
Code reformatted using: clang-format -style="LLVM"
http://reviews.llvm.org/D18264
Files:
clang-tidy/misc/AssignOperatorSignatureCheck.cpp
test/clang-tidy/misc-assign-operator-signature.cpp
Index:
baloghadamsoftware updated this revision to Diff 51520.
baloghadamsoftware added a comment.
Reverted to the original (accepted) version.
http://reviews.llvm.org/D18264
Files:
clang-tidy/misc/AssignOperatorSignatureCheck.cpp
test/clang-tidy/misc-assign-operator-signature.cpp
Index:
baloghadamsoftware added a comment.
Oh, I was searching in the C++ Core Guidlines, but at the wrong place because I
did not find it. So I will change this option to be enabled by default. DSL
users who do not follow this rule for the non copy and non move assign
operators can disable it.
baloghadamsoftware updated this revision to Diff 51437.
baloghadamsoftware added a comment.
Release notes fixed.
http://reviews.llvm.org/D18243
Files:
docs/LibASTMatchersReference.html
docs/ReleaseNotes.rst
include/clang/ASTMatchers/ASTMatchers.h
baloghadamsoftware updated this revision to Diff 51435.
baloghadamsoftware added a comment.
Check for non copy and move assign operators made optional.
http://reviews.llvm.org/D18264
Files:
clang-tidy/misc/AssignOperatorSignatureCheck.cpp
clang-tidy/misc/AssignOperatorSignatureCheck.h
baloghadamsoftware updated this revision to Diff 51418.
baloghadamsoftware added a comment.
Required fixes done.
http://reviews.llvm.org/D17987
Files:
clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp
clang-tidy/misc/MisplacedWideningCastCheck.cpp
baloghadamsoftware updated this revision to Diff 51287.
baloghadamsoftware added a comment.
Release notes updated.
http://reviews.llvm.org/D18243
Files:
docs/LibASTMatchersReference.html
docs/ReleaseNotes.rst
include/clang/ASTMatchers/ASTMatchers.h
baloghadamsoftware added a comment.
Prerequisites (matchers) are accepted now.
http://reviews.llvm.org/D17987
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
baloghadamsoftware added a comment.
My first thought was also to extend existing checker
misc-assign-operator-signature and rename it to just misc-assign-operator.
However, there is little benefit doing this: the two checkers check different
locations, one checks the signature while the other
baloghadamsoftware updated this revision to Diff 51263.
baloghadamsoftware added a comment.
LibASTMatchersReference.html updated
http://reviews.llvm.org/D18243
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
unittests/ASTMatchers/ASTMatchersTest.cpp
baloghadamsoftware updated this revision to Diff 51259.
baloghadamsoftware added a comment.
LibASTMatchersReference.html regenerated
http://reviews.llvm.org/D17986
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTMatchers/Dynamic/Registry.cpp
baloghadamsoftware added a comment.
I can rerun the script, however it seems it was not executed before the last
commit on the master branch, thus if I rerun it then changes will appear in my
diff which are not related to my work. What is the exect policy about running
this scipt? Should it be
baloghadamsoftware updated this revision to Diff 51167.
http://reviews.llvm.org/D18243
Files:
include/clang/ASTMatchers/ASTMatchers.h
unittests/ASTMatchers/ASTMatchersTest.cpp
Index: unittests/ASTMatchers/ASTMatchersTest.cpp
baloghadamsoftware updated this revision to Diff 51155.
http://reviews.llvm.org/D17986
Files:
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTMatchers/Dynamic/Registry.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
Index: unittests/ASTMatchers/ASTMatchersTest.cpp
baloghadamsoftware updated this revision to Diff 50932.
baloghadamsoftware added a comment.
Previous patch generation failed.
http://reviews.llvm.org/D17986
Files:
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTMatchers/Dynamic/Registry.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
baloghadamsoftware created this revision.
baloghadamsoftware added reviewers: alexfh, hokein.
baloghadamsoftware added subscribers: cfe-commits, xazax.hun.
The return value of every assign operator should be Type&, not only for copy
and move assign operators. This check and its test was
baloghadamsoftware retitled this revision from "[ASTMatchers] Existing matcher
hasAnyArgument fixed and new matcher hasReturnValue added" to "[ASTMatchers]
New matcher hasReturnValue added".
baloghadamsoftware updated the summary for this revision.
baloghadamsoftware updated this revision to
baloghadamsoftware created this revision.
baloghadamsoftware added reviewers: alexfh, hokein.
baloghadamsoftware added subscribers: cfe-commits, xazax.hun.
Finds return statements in assign operator bodies where the return value is
different from '*this'. Only assignment operators with correct
baloghadamsoftware created this revision.
baloghadamsoftware added reviewers: klimek, sbenza.
baloghadamsoftware added subscribers: cfe-commits, xazax.hun.
Herald added a subscriber: klimek.
A checker (will be uploaded after this patch) needs to check implicit casts.
The checker needs matcher
baloghadamsoftware added a comment.
In http://reviews.llvm.org/D17986#373134, @sbenza wrote:
> The reason we haven't fixed hasAnyArgument is that it can potentially break
> its users.
> I'd prefer if you separated the fix from the addition.
> That way we can revert the fix if needed.
I will
baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: klimek.
baloghadamsoftware added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
A checker (will be uploaded after this patch) needs to check implicit casts.
Existing generic matcher "has" ignores
baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: alexfh.
baloghadamsoftware added a subscriber: cfe-commits.
Existing checker misc-misplaced-widening-cast was extended:
- New use cases: casted expression as lhs or rhs of a logical comparison or
function argument
-
80 matches
Mail list logo