shuaiwang updated this revision to Diff 145313.
shuaiwang added a comment.
Revert "DeclRefExpr to volatile handling" part of last update.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang marked 5 inline comments as done.
shuaiwang added a comment.
I've reverted the handling of DeclRefExpr to volatile after rethinking about it.
The purpose of this analyzer is to find whether the given Expr is mutated
within a scope, but doesn't really care about external changes. In
shuaiwang updated this revision to Diff 146514.
shuaiwang marked 10 inline comments as done.
shuaiwang added a comment.
Rename to readability-simplify-subscript-expr and addressed other comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
shuaiwang updated this revision to Diff 146531.
shuaiwang marked 3 inline comments as done.
shuaiwang added a comment.
Handle unevaluated expressions.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
shuaiwang updated this revision to Diff 146532.
shuaiwang marked 3 inline comments as done.
shuaiwang added a comment.
Addressed review comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
shuaiwang added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)),
+ callee(namedDecl(hasName("data"
+ .bind("call",
shuaiwang added a comment.
In https://reviews.llvm.org/D45702#1101136, @aaron.ballman wrote:
> In https://reviews.llvm.org/D45702#1097294, @shuaiwang wrote:
>
> > Addressed review comments.
>
>
> This patch was approved; do you need someone to commit this for you?
Yes please :)
Repository:
shuaiwang added a comment.
In https://reviews.llvm.org/D45679#1131115, @aaron.ballman wrote:
> I had to revert due to failing tests. The revert was done in r334606 and this
> is an example of a failing bot:
>
shuaiwang updated this revision to Diff 151244.
shuaiwang added a comment.
Don't include in unit tests, should fix the test failures.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang updated this revision to Diff 151245.
shuaiwang added a comment.
Add include for std::isspace() (thanks aaron.ballman!)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang added a comment.
Overestimated the work of supporting typeid and _Generic, done now.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
shuaiwang updated this revision to Diff 149659.
shuaiwang marked 5 inline comments as done.
shuaiwang added a comment.
Handle sizeof on VLA.
Added test case for typeof()
Added TODO for handling typeid and generic selection.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
shuaiwang added inline comments.
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:34-38
+const ast_matchers::internal::VariadicDynCastAllOfMatcher
+cxxTypeidExpr;
+
+const ast_matchers::internal::VariadicDynCastAllOfMatcher
+cxxNoexceptExpr;
shuaiwang updated this revision to Diff 149661.
shuaiwang marked 4 inline comments as done.
shuaiwang added a comment.
Handle typeid and generic selection.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
shuaiwang added a comment.
Thanks a lot for the review!
Could you also help commit this diff as well? Thanks!
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
shuaiwang updated this revision to Diff 150026.
shuaiwang marked an inline comment as done.
shuaiwang added a comment.
Remove stale comment
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang added a comment.
Could someone help commit this now that the build issue with header include is
fixed? Thanks a lot!
(meanwhile I'm requesting commit access)
In https://reviews.llvm.org/D45679#1132327, @alexfh wrote:
> In https://reviews.llvm.org/D45679#1132086, @JonasToth wrote:
>
>
shuaiwang created this revision.
Herald added a reviewer: george.karpenkov.
Herald added subscribers: cfe-commits, a.sidorin.
This gives better coverage to the check as ExprMutationAnalyzer is more
accurate comparing to isOnlyUsedAsConst.
Majority of wins come from const usage of member field,
shuaiwang added a comment.
> Why do you think that looping is required? From my understanding, we
> need the first usage (DeclRefExpr) to get the analysis started. The
> analysis itself will check all remaining uses. Is this necessary,
> because we analysis on a `Expr` basis?
Yes. the
shuaiwang added a comment.
In https://reviews.llvm.org/D45702#1085224, @aaron.ballman wrote:
> > Have you run this over any large code bases to see whether the check
> > triggers in practice?
>
> I'm still curious about this, btw.
Yes it triggers in Google's code base.
Repository:
rCTE
shuaiwang added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)),
+ callee(namedDecl(hasName("data"
+ .bind("call",
shuaiwang added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ConstCheck.cpp:229-237
+ const auto *UseExpr = selectFirst("use", Usage);
+
+ // The declared variables was used in non-const conserving way and can not
+ // be declared as const.
+ if (UseExpr &&
shuaiwang updated this revision to Diff 144490.
shuaiwang marked 11 inline comments as done.
shuaiwang added a comment.
Added an isMutated overload for Decl.
A few more test cases.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/CMakeLists.txt
shuaiwang added a comment.
In https://reviews.llvm.org/D45702#1086250, @aaron.ballman wrote:
> In https://reviews.llvm.org/D45702#1085890, @shuaiwang wrote:
>
> > In https://reviews.llvm.org/D45702#1085224, @aaron.ballman wrote:
> >
> > > > Have you run this over any large code bases to see
shuaiwang updated this revision to Diff 145121.
shuaiwang marked 4 inline comments as done.
shuaiwang added a comment.
Addressed review comments, notably added check for DeclRefExpr to volatile
variables.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
shuaiwang added inline comments.
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:82-83
+const auto *E = RefNodes.getNodeAs("expr");
+if (findMutation(E))
+ return E;
+ }
aaron.ballman wrote:
> Why does this not return the result of
shuaiwang updated this revision to Diff 158856.
shuaiwang marked 2 inline comments as done.
shuaiwang added a comment.
Update comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50102
Files:
clang-tidy/performance/UnnecessaryValueParamCheck.cpp
shuaiwang added inline comments.
Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:108
return;
+ if (const auto *Ctor = dyn_cast(Function)) {
+for (const auto *Init : Ctor->inits()) {
hokein wrote:
> Is this a new fix or a special case
This revision was automatically updated to reflect the committed changes.
Closed by commit rL338903: Use ExprMutationAnalyzer in
performance-unnecessary-value-param (authored by shuaiwang, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
shuaiwang updated this revision to Diff 159037.
shuaiwang marked 2 inline comments as done.
shuaiwang added a comment.
Add comments explaining CXXCtorInitializer check
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50102
Files:
shuaiwang added a comment.
In https://reviews.llvm.org/D45679#1183116, @george.karpenkov wrote:
> @aaron.ballman @alexfh @shuaiwang Would it be possible to move that code into
> a matcher, or into a something which could be used from Clang? We would also
> like to use similar functionality,
shuaiwang created this revision.
Herald added a reviewer: george.karpenkov.
Herald added subscribers: cfe-commits, a.sidorin.
This yields better recall as ExprMutationAnalyzer is more accurate.
One common pattern this check is now able to catch is:
void foo(std::vector v) {
for (const
shuaiwang updated this revision to Diff 158408.
shuaiwang added a comment.
Add test case
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50102
Files:
clang-tidy/performance/UnnecessaryValueParamCheck.cpp
test/clang-tidy/performance-unnecessary-value-param.cpp
Index:
shuaiwang added a comment.
In https://reviews.llvm.org/D45444#1191874, @JonasToth wrote:
> > Could you give a concrete example of this?
>
> vi llvm/lib/Demangle/ItaniumDemangle.cpp +1762
>
> /home/jonas/opt/llvm/lib/Demangle/ItaniumDemangle.cpp:1762:7: warning:
> variable 'num' of type 'char
shuaiwang added a comment.
In https://reviews.llvm.org/D50447#1192393, @JonasToth wrote:
> ... just check if the variable is dereferenced in the scope of the loop (any
> declRefExpr exists).
+1
And I would imagine it's very rare (as in categories not raw number of
occurrences) for a loop
shuaiwang added a comment.
In https://reviews.llvm.org/D50447#1194967, @JonasToth wrote:
> Do you think it is a bad idea? If the variable is not used it is ok to
> ignore it in this particular circumstance. Other warnings/check should
> deal with such a situation IMHO.
>
> Am 10.08.2018 um
shuaiwang added a comment.
In https://reviews.llvm.org/D45444#1196271, @JonasToth wrote:
> Always the same with the templates ;) So uninstantiated templates should
> just be ignored.
>
> I think it would be better to have it in the ExprMutAnalyzer, because
> that part can not decide on
shuaiwang added a comment.
> - there seems to be a false positive with array-to-pointer decay.
> ExprMutAnalyzer does think of it, but maybe there is a bug in it.
Could you give a concrete example of this?
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45444
shuaiwang added inline comments.
Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:410
+ match(withEnclosingCompound(declRefTo("y")), AST->getASTContext());
+ EXPECT_THAT(mutatedBy(ResultsY, AST.get()), ElementsAre("y"));
+}
JonasToth wrote:
>
shuaiwang updated this revision to Diff 160960.
shuaiwang added a comment.
Test case with non-type template
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50619
Files:
clang-tidy/utils/ExprMutationAnalyzer.cpp
unittests/clang-tidy/ExprMutationAnalyzerTest.cpp
Index:
shuaiwang added inline comments.
Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:309
+TEST(ExprMutationAnalyzerTest, CallUnresolved) {
+ auto AST =
JonasToth wrote:
> I think we are missing tests for non-type template paramters (`template
> `).
shuaiwang updated this revision to Diff 160952.
shuaiwang marked 3 inline comments as done.
shuaiwang added a comment.
More test cases
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50619
Files:
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang updated this revision to Diff 160265.
shuaiwang added a comment.
update ast matchers doc
Repository:
rC Clang
https://reviews.llvm.org/D50605
Files:
docs/LibASTMatchersReference.html
include/clang/AST/ExprCXX.h
include/clang/ASTMatchers/ASTMatchers.h
shuaiwang marked an inline comment as done.
shuaiwang added inline comments.
Comment at: include/clang/AST/ExprCXX.h:3436
using const_arg_iterator = const Expr* const *;
+ using arg_const_range = llvm::iterator_range;
aaron.ballman wrote:
> Please name
This revision was automatically updated to reflect the committed changes.
Closed by commit rL339522: [ASTMatchers] Add matchers unresolvedMemberExpr,
cxxDependentScopeMemberExpr (authored by shuaiwang, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
shuaiwang updated this revision to Diff 160694.
shuaiwang marked 2 inline comments as done.
shuaiwang added a comment.
Herald added a subscriber: Szelethus.
- Fix a few cases overlooked previously
- More test cases
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50619
Files:
shuaiwang added a comment.
In https://reviews.llvm.org/D50619#1202135, @JonasToth wrote:
> @shuaiwang i tried to apply this and check the clang-tidy part again, but it
> does not compile (log attached).
> I update clang to master, did you add a matcher or something like this?
>
> F6950472:
shuaiwang created this revision.
shuaiwang added a reviewer: hokein.
Herald added subscribers: cfe-commits, Szelethus, a.sidorin, xazax.hun.
Herald added a reviewer: george.karpenkov.
For smart pointers like std::unique_ptr which uniquely owns the
underlying object, treat the mutation of the
shuaiwang updated this revision to Diff 160273.
shuaiwang marked 3 inline comments as done.
shuaiwang added a comment.
arg_const_range -> const_arg_range
Repository:
rC Clang
https://reviews.llvm.org/D50605
Files:
docs/LibASTMatchersReference.html
include/clang/AST/ExprCXX.h
shuaiwang created this revision.
shuaiwang added reviewers: aaron.ballman, JonasToth.
Herald added subscribers: cfe-commits, a.sidorin, xazax.hun.
Herald added a reviewer: george.karpenkov.
- If a function is unresolved, assume it mutates its arguments
- Follow unresolved member expressions for
shuaiwang created this revision.
shuaiwang added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.
Repository:
rC Clang
https://reviews.llvm.org/D50617
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
This revision was automatically updated to reflect the committed changes.
Closed by commit rL339530: [ASTMatchers] Let hasAnyArgument also support
CXXUnresolvedConstructExpr (authored by shuaiwang, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
shuaiwang updated this revision to Diff 160263.
shuaiwang marked 2 inline comments as done.
shuaiwang added a comment.
undo unrelated changes in doc
Repository:
rC Clang
https://reviews.llvm.org/D50606
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
shuaiwang created this revision.
Herald added a subscriber: cfe-commits.
Repository:
rC Clang
https://reviews.llvm.org/D50606
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTMatchers/ASTMatchersInternal.cpp
lib/ASTMatchers/Dynamic/Registry.cpp
shuaiwang created this revision.
Herald added a subscriber: cfe-commits.
Repository:
rC Clang
https://reviews.llvm.org/D50605
Files:
include/clang/AST/ExprCXX.h
include/clang/ASTMatchers/ASTMatchers.h
unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
Index:
shuaiwang added a comment.
In https://reviews.llvm.org/D50883#1203690, @JonasToth wrote:
> I am suprised that this does not automatically follow from the general rules.
> At the end, smartpointers cant do anything else then 'normal' classes.
>
> The `operator+/->` were not handled before? The
This revision was automatically updated to reflect the committed changes.
Closed by commit rC340547: [ASTMatchers] Let hasObjectExpression also support
UnresolvedMemberExpr… (authored by shuaiwang, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D50617?vs=161830=162218#toc
shuaiwang updated this revision to Diff 161830.
shuaiwang added a comment.
Fix issue with implicit access.
Repository:
rC Clang
https://reviews.llvm.org/D50617
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
shuaiwang added a comment.
In https://reviews.llvm.org/D50619#1207785, @JonasToth wrote:
> @shuaiwang Unfortunatly the analysis does not pass and fails on an assertion
>
> → ~/opt/llvm/build/bin/clang-tidy
> -checks=-*,cppcoreguidelines-const-correctness ItaniumDemangle.cpp --
> clang-tidy:
shuaiwang created this revision.
shuaiwang added reviewers: aaron.ballman, alexfh.
Herald added subscribers: cfe-commits, Szelethus, a.sidorin, xazax.hun.
Herald added a reviewer: george.karpenkov.
This handles cases like this:
typedef int& IntRef;
void mutate(IntRef);
void f() {
int
shuaiwang added a comment.
Ping :)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50619
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shuaiwang added a comment.
In https://reviews.llvm.org/D45679#1183116, @george.karpenkov wrote:
> @aaron.ballman @alexfh @shuaiwang Would it be possible to move that code into
> a matcher, or into a something which could be used from Clang? We would also
> like to use similar functionality,
shuaiwang added a comment.
In https://reviews.llvm.org/D50883#1229297, @JonasToth wrote:
> > Different from std::vector::operator[] which has two overloads for const
> > and non-const access, std::unique_ptr only has one const version of
> > `operator->`.
> >
> > So for SmartPtr x; x->mf();
shuaiwang accepted this revision.
shuaiwang added a comment.
This revision is now accepted and ready to land.
LGTM :)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D51884
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
shuaiwang added a comment.
I have a rough idea about how `findPointeeMutation` would look like, I'm pretty
sure I can use a lot of your help :)
My current plan:
- Finish the few existing pending changes
- Move the analyzer to `clang/lib/Analysis` (likely remove
`PseudoConstantAnalysis` there
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE341848: [clang-tidy] Handle unresolved expressions in
ExprMutationAnalyzer (authored by shuaiwang, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D50619?vs=160960=164704#toc
shuaiwang updated this revision to Diff 164773.
shuaiwang added a comment.
rebase
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D51898
Files:
clang-tidy/utils/ExprMutationAnalyzer.cpp
unittests/clang-tidy/ExprMutationAnalyzerTest.cpp
Index:
This revision was not accepted when it landed; it landed in state "Needs
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL341886: Revert [clang-tidy] Handle unresolved
expressions in ExprMutationAnalyzer (authored by shuaiwang, committed by
shuaiwang created this revision.
Herald added subscribers: cfe-commits, Szelethus, a.sidorin, xazax.hun.
Herald added a reviewer: george.karpenkov.
Tests somehow break on windows (and only on windows)
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/13003
shuaiwang updated this revision to Diff 164810.
shuaiwang marked an inline comment as done.
shuaiwang added a comment.
rebase & add test case
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50883
Files:
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang added inline comments.
Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:658
+ "void f() { UniquePtr x; x->mf(); }");
+ Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
+ EXPECT_FALSE(isMutated(Results,
shuaiwang updated this revision to Diff 164806.
shuaiwang marked 2 inline comments as done.
shuaiwang added a comment.
more test cases.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50953
Files:
clang-tidy/utils/ExprMutationAnalyzer.cpp
shuaiwang added a comment.
In https://reviews.llvm.org/D50953#1229287, @JonasToth wrote:
> What happens to pointers in a typedef (in the sense of `*` instead of `&`)?
I checked around and I believe reference type is the only type we're explicitly
matching right now. We'll need to handle
This revision was automatically updated to reflect the committed changes.
shuaiwang marked an inline comment as done.
Closed by commit rL336737: Use ExprMutationAnalyzer in
performance-for-range-copy (authored by shuaiwang, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
shuaiwang marked an inline comment as done.
shuaiwang added inline comments.
Comment at: test/clang-tidy/performance-for-range-copy.cpp:120
+struct Point {
+ ~Point() {}
JonasToth wrote:
> I feel that `const` methods should be added as a test as well.
const
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE342006: [clangtidy] Remove old copy of
ExprMutationAnalyzer (authored by shuaiwang, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D51950?vs=164977=164991#toc
Repository:
rCTE
shuaiwang marked an inline comment as done.
shuaiwang added a comment.
Hi @alexfh, @hokein, @JonasToth, I've updated this diff to be just adding the
helper function `isModified()` with a set of dedicated unit tests. What do you
think of the approach of getting this change committed and then
shuaiwang updated this revision to Diff 142739.
shuaiwang added a comment.
Change to just add a helper function `isModified`
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/ASTUtils.cpp
clang-tidy/utils/ASTUtils.h
shuaiwang updated this revision to Diff 142882.
shuaiwang added a comment.
Better range for loop handling.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/ASTUtils.cpp
clang-tidy/utils/ASTUtils.h
unittests/clang-tidy/CMakeLists.txt
shuaiwang added a comment.
>> I would imagine things could get messier if this check expands to also
>> check for turning member functions const: it's basically checking
>> CxxThisExpr, being a handle, is not modified within a member function, but
>> note there's no VarDecl for "this".
>
>
shuaiwang added a comment.
In https://reviews.llvm.org/D45444#1068967, @Eugene.Zelenko wrote:
> In https://reviews.llvm.org/D45444#1068496, @shuaiwang wrote:
>
> > - I would imagine things could get messier if this check expands to also
> > check for turning member functions const: it's
shuaiwang created this revision.
Herald added subscribers: cfe-commits, mgorny, klimek.
shuaiwang added a reviewer: hokein.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
shuaiwang created this revision.
Herald added subscribers: cfe-commits, xazax.hun, mgorny, klimek.
shuaiwang added a reviewer: sbenza.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
shuaiwang added a comment.
Coming from https://reviews.llvm.org/D45679, which I should have sent out much
earlier to get in front of you :p
Kidding aside this check is more mature than mine and I'm happy to help
incorporate mine into this one.
I do have a strong opinion that requires
shuaiwang added a comment.
In https://reviews.llvm.org/D45679#1069754, @Eugene.Zelenko wrote:
> In https://reviews.llvm.org/D45679#1069638, @JonasToth wrote:
>
> > *hust* /llvm/tools/clang/lib/Analysis/PseudoConstantAnalysis.cpp
> >
> > I will check this one first, before we get crazy and
shuaiwang updated this revision to Diff 142878.
shuaiwang added a comment.
Handle range-based for loop
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45679
Files:
clang-tidy/utils/ASTUtils.cpp
clang-tidy/utils/ASTUtils.h
unittests/clang-tidy/CMakeLists.txt
shuaiwang updated this revision to Diff 142730.
shuaiwang added a comment.
Updated mostly `isModified()`.
I'd like to mostly demonstrate that `isModified()` works given that there's
https://reviews.llvm.org/D45444 and we'd like to merge.
Repository:
rCTE Clang Tools Extra
shuaiwang added a comment.
I've updated https://reviews.llvm.org/D45679 and I think the `isModified()`
function there is now sufficiently covering the cases you've covered here and
can be used as a good starting version if you plan to use it here.
I copied your const-values test cases and it
shuaiwang updated this revision to Diff 142870.
shuaiwang edited the summary of this revision.
shuaiwang added a comment.
Handle casts, ternary operator and lambdas.
Also optionally returns a chain of Stmt giving more details about how the
conclusion is reached.
Repository:
rCTE Clang Tools
shuaiwang updated this revision to Diff 143197.
shuaiwang marked 13 inline comments as done.
shuaiwang added a comment.
- Moved out of ASTUtils and becomes a separte class ExprMutationAnalyzer
(bikeshedding on name a bit.)
- Reverted back to return bool instead of tri-valued enum, the meanings
shuaiwang added a comment.
Regarding full dependency analysis, I think it's out of the scope of this
change at least for now. We're only trying to find //one// possible point where
the given `Expr` is (assumed to be) mutated. This is known to be useful at this
point for use cases like "check
shuaiwang updated this revision to Diff 143204.
shuaiwang marked 7 inline comments as done.
shuaiwang added a comment.
Addressed review comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
shuaiwang updated this revision to Diff 143207.
shuaiwang marked 7 inline comments as done.
shuaiwang added a comment.
Addressed more comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
shuaiwang added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:22
+
+const char kDefaultTypes[] =
+"::std::basic_string;::std::basic_string_view;::std::vector;::std::array";
Eugene.Zelenko wrote:
> Actually you should use
shuaiwang created this revision.
Herald added subscribers: cfe-commits, klimek.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45153
Files:
clang-tidy/utils/ASTUtils.cpp
clang-tidy/utils/ASTUtils.h
Index: clang-tidy/utils/ASTUtils.h
shuaiwang created this revision.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus,
a.sidorin, mgorny.
Herald added a reviewer: george.karpenkov.
This just copies ExprMutationAnalyzer to Tooling/Analysis with minor tweaks
around including path & namespaces.
2/3 will change
shuaiwang created this revision.
shuaiwang added reviewers: george.karpenkov, rsmith, dblaikie.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus,
a.sidorin, mgorny.
shuaiwang added a dependency: D54399: Move ExprMutationAnalyzer to
Tooling/Analysis (1/3).
Reference the new
shuaiwang updated this revision to Diff 168578.
shuaiwang marked 5 inline comments as done.
shuaiwang added a comment.
Resolved review comments.
Repository:
rC Clang
https://reviews.llvm.org/D52219
Files:
include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
shuaiwang marked 5 inline comments as done.
shuaiwang added inline comments.
Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:67
+if (const auto *DRE = dyn_cast(E)) {
+ if (DRE->getNameInfo().getAsString()[0] == 'p')
+Finder = PointeeMutationFinder;
shuaiwang updated this revision to Diff 166595.
shuaiwang marked 5 inline comments as done.
shuaiwang added a comment.
Addresses review comments.
Repository:
rC Clang
https://reviews.llvm.org/D52219
Files:
include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
1 - 100 of 145 matches
Mail list logo