This revision was automatically updated to reflect the committed changes.
Closed by commit rL287540: readability-redundant-declaration: Fix crash
(authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D26911?vs=78706&id=78715#toc
Repository:
rL LLVM
https://reviews
This revision was automatically updated to reflect the committed changes.
Closed by commit rL285689: [clang-tidy] Add check
readability-redundant-declaration (authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D24656?vs=74478&id=76548#toc
Repository:
rL LLVM
htt
This revision was automatically updated to reflect the committed changes.
Closed by commit rL284477: alpha.core.UnreachableCode - don't warn about
unreachable code inside macro (authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D25606?vs=74849&id=74990#toc
Reposit
danielmarjamaki added a comment.
Ping.
Repository:
rL LLVM
https://reviews.llvm.org/D24656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki updated this revision to Diff 74849.
danielmarjamaki added a comment.
make pattern to avoid warnings more specific
Repository:
rL LLVM
https://reviews.llvm.org/D25606
Files:
lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
test/Analysis/unreachable-code-path.c
Ind
danielmarjamaki created this revision.
danielmarjamaki added reviewers: NoQ, dcoughlin.
danielmarjamaki added subscribers: cfe-commits, xazax.hun, zaks.anna, a.sidorin.
danielmarjamaki set the repository for this revision to rL LLVM.
This patch fixes false positives for such code:
#define RETUR
danielmarjamaki created this revision.
danielmarjamaki added a reviewer: NoQ.
danielmarjamaki added subscribers: cfe-commits, xazax.hun, dcoughlin.
danielmarjamaki set the repository for this revision to rL LLVM.
This patch fix false positives for loss of sign in addition and subtraction
assignme
danielmarjamaki added a comment.
I agree with the comments from you dcoughlin but I am not sure how to do it.
> Can you also add a test that tests this more directly (i.e., with
> clang_analyzer_warnIfReached). I don't think it is good to have the only test
> for this core coverage issue to be
danielmarjamaki added a comment.
Ping
Repository:
rL LLVM
https://reviews.llvm.org/D24861
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki set the repository for this revision to rL LLVM.
danielmarjamaki updated this revision to Diff 74478.
danielmarjamaki added a comment.
Herald added a subscriber: modocache.
changed cast(D)->getName() to cast(D)
Repository:
rL LLVM
https://reviews.llvm.org/D24656
Files:
clan
danielmarjamaki added inline comments.
Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:60
+auto Diag = diag(D->getLocation(), "redundant '%0' declaration")
+<< cast(D)->getName();
+if (!MultiVar && !DifferentHeaders)
alexfh wrote:
danielmarjamaki added a comment.
In https://reviews.llvm.org/D25326#564584, @zaks.anna wrote:
> Please, fix the style issues before committing.
Sorry I missed that.
Ideally it would be possible to run clang-format on the files before
committing. but currently I get lots of unrelated changes t
danielmarjamaki added inline comments.
Comment at: test/Analysis/unreachable-code-path.c:201
+static int inlineFunction(const int i) {
+ if (table[i] != 0)
+return 1;
NoQ wrote:
> a.sidorin wrote:
> > I have a small question. Is it possible to simplify this
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283554: [analyzer] Don't merge different return nodes in
ExplodedGraph (authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D25326?vs=73926&id=73947#toc
Repository:
rL LLV
danielmarjamaki removed rL LLVM as the repository for this revision.
danielmarjamaki updated this revision to Diff 73926.
danielmarjamaki added a comment.
Refactoring.
https://reviews.llvm.org/D25326
Files:
include/clang/Analysis/ProgramPoint.h
include/clang/StaticAnalyzer/Core/PathSensitiv
danielmarjamaki added a comment.
In https://reviews.llvm.org/D25326#564291, @danielmarjamaki wrote:
> In https://reviews.llvm.org/D25326#564283, @NoQ wrote:
>
> > In https://reviews.llvm.org/D25326#564239, @danielmarjamaki wrote:
> >
> > > ok. As far as I see it's not trivial to know which Return
danielmarjamaki added a comment.
In https://reviews.llvm.org/D25326#564283, @NoQ wrote:
> In https://reviews.llvm.org/D25326#564239, @danielmarjamaki wrote:
>
> > ok. As far as I see it's not trivial to know which ReturnStmt there was
> > when CallExitBegin is created.
>
>
> We're in `HandleBloc
danielmarjamaki added a comment.
ok. As far as I see it's not trivial to know which ReturnStmt there was when
CallExitBegin is created. Do you suggest that I move it or that I try to lookup
the ReturnStmt? I guess it can be looked up by looking in the predecessors in
the ExplodedGraph?
> Final
danielmarjamaki added a comment.
In https://reviews.llvm.org/D25326#564082, @NoQ wrote:
> Funny facts about the Environment:
>
> (a) Environment allows taking SVals of ReturnStmt, which is not an
> expression, by transparently converting it into its sub-expression. In fact,
> it only stores exp
danielmarjamaki added reviewers: NoQ, zaks.anna, dcoughlin, a.sidorin,
xazax.hun.
danielmarjamaki added a comment.
adding reviewers.
Repository:
rL LLVM
https://reviews.llvm.org/D25326
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
danielmarjamaki created this revision.
danielmarjamaki added subscribers: cfe-commits, dcoughlin, NoQ.
danielmarjamaki set the repository for this revision to rL LLVM.
Returns when calling an inline function should not be merged in the
ExplodedGraph unless they are same.
Background post on cfe-d
danielmarjamaki added inline comments.
> MisleadingIndentationCheck.cpp:20
> +
> +void MisleadingIndentationCheck::danglingElseCheck(
> +const MatchFinder::MatchResult &Result) {
There is no handling of tabs and spaces by danglingElseCheck as far as I see.
The "if" might for example be inde
danielmarjamaki set the repository for this revision to rL LLVM.
danielmarjamaki updated this revision to Diff 73633.
danielmarjamaki added a comment.
Add new flag : -Wshift-op-parentheses-mul
This is not enabled by default.
Repository:
rL LLVM
https://reviews.llvm.org/D24861
Files:
includ
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
Ping.
I am not very happy about how I detect multivariable declarations. But I really
don't see any such info in the VarDecl. For instance, the AST dump does not
show this info.
https://reviews.llvm.org/D24656
Hello!
Moving it to a subgroup such as -Wparentheses is fine for me. I will look at
that when I have time. Do you think this warning has an acceptable output then?
Best regards,
Daniel Marjamäki
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
danielmarjamaki closed this revision.
danielmarjamaki added a comment.
r283095
https://reviews.llvm.org/D24759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki marked 3 inline comments as done.
Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:39
@@ +38,3 @@
+ bool MultiVar = false;
+ if (const auto *VD = dyn_cast(D)) {
+if (VD && VD->getPreviousDecl()->getStorageClass() == SC_Extern &&
--
danielmarjamaki updated this revision to Diff 72802.
danielmarjamaki added a comment.
Fix review comments
https://reviews.llvm.org/D24656
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tidy/readability/RedundantDeclarationCheck.cpp
cl
danielmarjamaki added a comment.
I updated the patch so it does not warn about 'A * B << C'. It's a simple fix.
I have not made careful measurements but I guess that the performance penalty
is acceptable.
https://reviews.llvm.org/D24861
___
cfe-co
danielmarjamaki removed rL LLVM as the repository for this revision.
danielmarjamaki updated this revision to Diff 72797.
danielmarjamaki added a comment.
Don't write warning for multiplication in LHS of <<. Often the execution order
is not important.
https://reviews.llvm.org/D24861
Files:
l
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:
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
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
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
danielmarjamaki added a comment.
Compiling 2064 projects resulted in 904 warnings
Here are the results:
https://drive.google.com/file/d/0BykPmWrCOxt2N04tYl8zVHA3MXc/view?usp=sharing
The results looks acceptable imho. The code looks intentional in many cases so
I believe there are users that wil
danielmarjamaki updated this revision to Diff 72461.
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
Fixed review comments by Devin. It works better now!
https://reviews.llvm.org/D24759
Files:
lib/Analysis/CFG.cpp
test/Analysis/unreachable-code-path.c
Ind
danielmarjamaki added inline comments.
Comment at: lib/Analysis/CFG.cpp:2986
@@ -2985,3 +2985,1 @@
-if (!KnownVal.isFalse()) {
- // Add an intermediate block between the BodyBlock and the
dcoughlin wrote:
> You need to keep this check so that the optimi
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
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.
```
danielmarjamaki created this revision.
danielmarjamaki added reviewers: dblaikie, rtrieu.
danielmarjamaki added a subscriber: cfe-commits.
danielmarjamaki set the repository for this revision to rL LLVM.
This patch makes Clang warn about following code:
a = (b * c >> 2);
It might be a good i
danielmarjamaki abandoned this revision.
danielmarjamaki added a comment.
Fixed by r282242
https://reviews.llvm.org/D16309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki added a comment.
My change is causing a false negative in the
test/Analysis/uninit-sometimes.cpp. As far as I see my change anyway makes the
unoptimized CFG better.
https://reviews.llvm.org/D24759
___
cfe-commits mailing list
cfe-c
danielmarjamaki updated this revision to Diff 72252.
danielmarjamaki added a comment.
Updated CFGBuilder::VisitDoStmt
https://reviews.llvm.org/D24759
Files:
lib/Analysis/CFG.cpp
test/Analysis/uninit-sometimes.cpp
test/Analysis/unreachable-code-path.c
Index: test/Analysis/unreachable-code
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282156: Fix Wbitfield-constant-conversion false positives
(authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D24232?vs=70325&id=72169#toc
Repository:
rL LLVM
https://re
danielmarjamaki added a comment.
Thanks!
I somehow missed your answer in cfe-dev.
I will continue working on this and hopefully have a proper patch soon.
https://reviews.llvm.org/D24759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http:
danielmarjamaki added a subscriber: danielmarjamaki.
Comment at: include/clang/Basic/AttrDocs.td:2055
@@ -2054,1 +2054,3 @@
}
+def WarnImpcastToBoolDocs : Documentation {
+ let Category = DocCatFunction;
I saw your email on cfe-dev. This sounds like a good idea
danielmarjamaki added a comment.
ping.
https://reviews.llvm.org/D16309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki marked an inline comment as done.
danielmarjamaki added a comment.
https://reviews.llvm.org/D24656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki removed rL LLVM as the repository for this revision.
danielmarjamaki updated this revision to Diff 71775.
danielmarjamaki added a comment.
run clang-format on test. add release notes.
https://reviews.llvm.org/D24656
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/rea
danielmarjamaki added a subscriber: cfe-commits.
danielmarjamaki added a comment.
ping
https://reviews.llvm.org/D24232
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki added a comment.
> Will be good idea to detect redundant function prototypes.
Yes.
Should that have the same ID though? Is it better to have one
readability-redundant-declaration or two separate
readability-redundant-variable-declaration and
readability-redundant-function-dec
danielmarjamaki added a comment.
> However, I think this check should be part of Clang diagnostics. GCC has
> -Wredundant-decls for a long time.
I am not against that.
What is the criteria? When should it be in the compiler and when should it be
in clang-tidy?
Personally I think it's natural
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
https://reviews.llvm.org/D24656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki updated this revision to Diff 71614.
danielmarjamaki added a comment.
minor fixes
https://reviews.llvm.org/D24656
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tidy/readability/RedundantDeclarationCheck.cpp
clang-tidy
danielmarjamaki added a comment.
For information, I am testing this on debian packages right now. I will see the
results next week.
Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:22
@@ +21,3 @@
+void RedundantDeclarationCheck::registerMatchers(MatchFinder *Fin
danielmarjamaki created this revision.
danielmarjamaki added a reviewer: alexfh.
danielmarjamaki added a subscriber: cfe-commits.
Herald added subscribers: mgorny, beanz.
This is a new check that warns about redundant variable declarations.
https://reviews.llvm.org/D24656
Files:
clang-tidy/rea
This revision was automatically updated to reflect the committed changes.
Closed by commit rL281206: [clang-tidy] readability-misplaced-array-index: add
new check that warns when… (authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D21134?vs=69558&id=70994#toc
Repo
danielmarjamaki abandoned this revision.
danielmarjamaki added a comment.
hmm.. I don't actually care much about this specific check at the moment.
I saw other false positives (unreachable code) and thought that this check made
the analyzer think there was corrupted memory.
Now I can't reproduc
danielmarjamaki added a comment.
If the -fno-strict-aliasing would fix this warning then it would be OK.
If you are telling me that this CastToStruct check is about alignment or
endianness then I think the message is highly misleading. We should rewrite the
message.
In general, using char inst
danielmarjamaki marked 4 inline comments as done.
danielmarjamaki added a comment.
https://reviews.llvm.org/D21134
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki updated this revision to Diff 69558.
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
fix review comments
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/MisplacedArrayIndexCheck.cpp
clan
danielmarjamaki marked 6 inline comments as done.
Comment at: clang-tidy/readability/MisplacedArrayIndexCheck.cpp:57
@@ +56,2 @@
+} // namespace tidy
+} // namespace clang
I removed hasMacroId() and use fixit::getText(). The replacements look good now.
==
danielmarjamaki updated this revision to Diff 69113.
danielmarjamaki added a comment.
fixed review comments
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/MisplacedArrayIndexCheck.cpp
clang-tidy/readability/MisplacedArrayIndexCheck.h
This revision was automatically updated to reflect the committed changes.
Closed by commit rL279507: [clang-tidy] readability-non-const-parameter: add
new check that warns when… (authored by danielmarjamaki).
Changed prior to commit:
https://reviews.llvm.org/D15332?vs=68531&id=68963#toc
Reposi
danielmarjamaki updated this revision to Diff 68531.
danielmarjamaki added a comment.
Fixed review comments about formatting in doc
https://reviews.llvm.org/D15332
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/NonConstParameterCheck.cpp
clang-tidy/readability/NonCons
danielmarjamaki updated this revision to Diff 68528.
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
Fixed review comments
https://reviews.llvm.org/D15332
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/NonConstParameterCheck.cpp
clan
danielmarjamaki marked 6 inline comments as done.
Comment at: clang-tidy/readability/NonConstParameterCheck.cpp:95-98
@@ +94,6 @@
+const QualType T = VD->getType();
+if (T->isPointerType() && !T->getPointeeType().isConstQualified())
+ markCanNotBeConst(VD->getInit(),
danielmarjamaki added inline comments.
Comment at: clang-tidy/readability/NonConstParameterCheck.cpp:95-98
@@ +94,6 @@
+const QualType T = VD->getType();
+if (T->isPointerType() && !T->getPointeeType().isConstQualified())
+ markCanNotBeConst(VD->getInit(), true);
+
danielmarjamaki marked 3 inline comments as done.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:67
@@ +66,3 @@
+ const Stmt *Parent = PM.getParent(Cast);
+ if (!Parent)
+return;
I get assertion failure then when running this test:
Analysis/
danielmarjamaki updated this revision to Diff 67817.
danielmarjamaki added a comment.
fixed review comments
https://reviews.llvm.org/D13126
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
lib/StaticAnalyzer/Checkers/ConversionChecker.cpp
danielmarjamaki updated this revision to Diff 67506.
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
added this check to the release notes. run clang-format.
https://reviews.llvm.org/D15332
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readabilit
danielmarjamaki marked 2 inline comments as done.
Comment at: test/clang-tidy/readability-non-const-parameter.cpp:245
@@ +244,3 @@
+ C c(p);
+}
+
I have added tests and fixed FPs in latest diff.
Comment at: test/clang-tidy/readability-non-const-
danielmarjamaki updated this revision to Diff 67504.
danielmarjamaki added a comment.
fixed more review comments
https://reviews.llvm.org/D15332
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/NonConstParameterCheck.cpp
clang-tidy/readability/NonConstParameterCheck.h
danielmarjamaki marked 10 inline comments as done.
Comment at: test/clang-tidy/readability-non-const-parameter.cpp:117-135
@@ +116,21 @@
+// CHECK-MESSAGES: :[[@LINE+1]]:18: warning: pointer parameter 'p' can be
+int return1(int *p) {
+ // CHECK-FIXES: {{^}}int return1(const int
danielmarjamaki updated this revision to Diff 67500.
danielmarjamaki added a comment.
Fix patch so it can be applied in latest trunk. Tried to fix review comments.
https://reviews.llvm.org/D15332
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/NonConstParameterCheck.cpp
danielmarjamaki updated this revision to Diff 67470.
danielmarjamaki added a comment.
Make sure patch can be applied in latest trunk.
Ping.
https://reviews.llvm.org/D13126
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
lib/StaticAnalyz
danielmarjamaki marked an inline comment as done.
danielmarjamaki added a comment.
https://reviews.llvm.org/D21134
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
danielmarjamaki updated this revision to Diff 67338.
danielmarjamaki added a comment.
ran clang-format
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/MisplacedArrayIndexCheck.cpp
clang-tidy/readability/MisplacedArrayIndexCheck.h
clang
danielmarjamaki updated this revision to Diff 67337.
danielmarjamaki added a comment.
More generic diagnostic. Diagnose all integerType[pointerType] expressions.
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/MisplacedArrayIndexCheck.cpp
danielmarjamaki marked 2 inline comments as done.
Comment at: test/clang-tidy/readability-misplaced-array-index.cpp:31
@@ +30,3 @@
+ x[10] = 0;
+ dostuff(0[0 + ABC]);
+}
aaron.ballman wrote:
> Why is this considered to be "normal syntax" and not worth getting a
danielmarjamaki marked 4 inline comments as done.
danielmarjamaki added a comment.
as far as I see the only unsolved review comment now is about macros. if it can
be handled better.
Comment at: clang-tidy/readability/MisplacedArrayIndexCheck.cpp:28-29
@@ +27,4 @@
+
danielmarjamaki updated this revision to Diff 67322.
danielmarjamaki added a comment.
take care of review comments
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/MisplacedArrayIndexCheck.cpp
clang-tidy/readability/MisplacedArrayIndexChe
danielmarjamaki added a comment.
In https://reviews.llvm.org/D21134#508524, @jroelofs wrote:
> I think the replacement is wrong for something like:
>
> int *arr; int offs1, offs2;
> offs1[arr + offs2] = 42;
>
>
> which I think would give:
>
> int *arr; int offs1, offs2;
> arr + offs2[offs
danielmarjamaki marked an inline comment as done.
danielmarjamaki added a comment.
In https://reviews.llvm.org/D21134#508511, @aaron.ballman wrote:
> Is there a reason we don't want this check to be a part of the clang
> frontend, rather than as a clang-tidy check?
I discussed this with fronte
danielmarjamaki removed rL LLVM as the repository for this revision.
danielmarjamaki updated this revision to Diff 67145.
danielmarjamaki added a comment.
Cleanup my previous commit. Ran clang-format.
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/re
danielmarjamaki set the repository for this revision to rL LLVM.
danielmarjamaki updated this revision to Diff 67144.
danielmarjamaki added a comment.
Fixed review comments.
Repository:
rL LLVM
https://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readab
danielmarjamaki added inline comments.
Comment at: clang-tidy/readability/MisplacedArrayIndexCheck.cpp:43
@@ +42,3 @@
+
+static StringRef getAsString(const MatchFinder::MatchResult &Result,
+ const Expr *E) {
alexfh wrote:
> Looks like
danielmarjamaki updated this revision to Diff 60804.
danielmarjamaki added a comment.
fixed typo in releasenotes
http://reviews.llvm.org/D21134
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/MisplacedArrayIndexCheck.cpp
clang-tidy/readability/MisplacedArrayIndexCheck.
danielmarjamaki removed rL LLVM as the repository for this revision.
danielmarjamaki updated this revision to Diff 60803.
danielmarjamaki added a comment.
updated releasedocs
deeper lookup if macro is used
only warn when the replacement can be done safely. the expressions "x[y+z]" and
y+z[x]" are
danielmarjamaki created this revision.
danielmarjamaki added a reviewer: alexfh.
danielmarjamaki added a subscriber: cfe-commits.
danielmarjamaki set the repository for this revision to rL LLVM.
this is a new check for clang-tidy that diagnoses when it see unusual array
index syntax.
there is no
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272128 (authored by danielmarjamaki).
Changed prior to commit:
http://reviews.llvm.org/D20853?vs=59208&id=60013#toc
Repository:
rL LLVM
http://reviews.llvm.org/D20853
Files:
clang-tools-extra/trun
danielmarjamaki removed rL LLVM as the repository for this revision.
danielmarjamaki updated this revision to Diff 59208.
danielmarjamaki added a comment.
Updated diff. Now also handles bugzilla 27399.
http://reviews.llvm.org/D20853
Files:
clang-tidy/misc/MacroParenthesesCheck.cpp
test/clan
danielmarjamaki added a comment.
> The "possibleVarDecl" could be much more clever. For instance, variable
> declarations can at least contain :: < & also, I could handle those better
> also but that would mean more false negatives.
I now saw bugzilla 27399 also.
I do need to handle templates
danielmarjamaki created this revision.
danielmarjamaki added subscribers: cfe-commits, alexfh.
danielmarjamaki set the repository for this revision to rL LLVM.
This is a quick fix for bugzilla 26273. parentheses should not be inserted in
variable declarations.
This patch will introduce false neg
danielmarjamaki added a comment.
In http://reviews.llvm.org/D13126#381772, @zaks.anna wrote:
> Could you add the reduced false positives to the tests file?
>
> > As far as I see the diagnostics are showing the proper path now..
>
>
> What do you mean? Does this refer to supplying more information
danielmarjamaki updated this revision to Diff 52029.
danielmarjamaki marked 2 inline comments as done.
danielmarjamaki added a comment.
Minor fixes of review comments. Renamed functions to "isNegative" and
"isGreaterEqual" and return bool. Updated comment. Added testcases for false
positives I h
danielmarjamaki marked 3 inline comments as done.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:12
@@ +11,3 @@
+//
+// ConversionChecker generates a subset of the warnings that are reported by
+// Wconversion. It is designed to be an alternative to Wconversion.
---
danielmarjamaki updated this revision to Diff 51402.
danielmarjamaki added a comment.
Minor fixes of review comments.
- Improved comments about the checker in the source code.
- Improved capitalization and punctuation in error messages.
- Renamed "canBe..." functions and changed their return type
danielmarjamaki added a comment.
Here are some false positives I have marked... let me know if you want more...
I have marked this as a FP:
URL:
ftp://ftp.se.debian.org/debian/pool/main/m/m17n-lib/m17n-lib_1.7.0.orig.tar.gz
File: m17n-lib-1.7.0/src/mtext.c
Line 1946
Code:
int mtext_set_cha
1 - 100 of 222 matches
Mail list logo