NoQ added a comment.
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 `HandleBlockEdge`, just pass down the statement from CFG here?
In https://reviews.llvm.or
Author: dergachev
Date: Fri Oct 7 05:44:09 2016
New Revision: 283536
URL: http://llvm.org/viewvc/llvm-project?rev=283536&view=rev
Log:
[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Replace SmallVector with a vector of plain pointers.
Would insignificantly increase memo
NoQ added a comment.
In https://reviews.llvm.org/D25326#564291, @danielmarjamaki wrote:
> The Blk->dump() says:
>
> [B0 (EXIT)]
> Preds (2): B1 B2
>
What about the source block?
Repository:
rL LLVM
https://reviews.llvm.org/D25326
___
cf
Author: dergachev
Date: Fri Oct 7 05:56:44 2016
New Revision: 283537
URL: http://llvm.org/viewvc/llvm-project?rev=283537&view=rev
Log:
Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Vector of smart pointers wasn't the thing that caused msvc crash.
Modified:
Author: dergachev
Date: Fri Oct 7 06:26:15 2016
New Revision: 283540
URL: http://llvm.org/viewvc/llvm-project?rev=283540&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.3, in small chunks this time.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
Modif
Author: dergachev
Date: Fri Oct 7 06:29:32 2016
New Revision: 283541
URL: http://llvm.org/viewvc/llvm-project?rev=283541&view=rev
Log:
Revert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.
Yay, this is great. Thanks for investigating all those loss of coverage issues!
Comment at: lib/StaticAnalyzer/Core/CoreEngine.cpp:610
// Use the callee location context.
- Cal
Author: dergachev
Date: Fri Oct 7 10:23:02 2016
New Revision: 283566
URL: http://llvm.org/viewvc/llvm-project?rev=283566&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.4, a small chunk.
Define PathDiagnosticNotePiece. The next commit would be able to address the
BugReport class code that
Author: dergachev
Date: Fri Oct 7 10:55:18 2016
New Revision: 283568
URL: http://llvm.org/viewvc/llvm-project?rev=283568&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.4, chunk no.2.
Define the list of pieces in BugReport class. This is half of the changes
in the BugReport class code, whi
NoQ added inline comments.
Comment at: test/Analysis/unreachable-code-path.c:201
+static int inlineFunction(const int i) {
+ if (table[i] != 0)
+return 1;
a.sidorin wrote:
> I have a small question. Is it possible to simplify this sample with removing
> of
Author: dergachev
Date: Fri Oct 7 12:12:05 2016
New Revision: 283573
URL: http://llvm.org/viewvc/llvm-project?rev=283573&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.4, chunk no.3.
This is the primary suspect for causing the msvc crash, now that vector of
smart pointers was proven to be
Author: dergachev
Date: Fri Oct 7 12:24:06 2016
New Revision: 283574
URL: http://llvm.org/viewvc/llvm-project?rev=283574&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.
Remove the brace default initializer to see if this is what's causing
the msvc crash.
Modified:
Author: dergachev
Date: Fri Oct 7 14:25:10 2016
New Revision: 283584
URL: http://llvm.org/viewvc/llvm-project?rev=283584&view=rev
Log:
[analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)
The problem that caused the msvc crash has been indentified and fixed
in the previous commit. This p
r the trouble.
7 октября 2016 г. 23:33:39 GMT+03:00, Bill Seurer
пишет:
>On 10/07/16 05:56, Artem Dergachev via cfe-commits wrote:
> > Author: dergachev
> > Date: Fri Oct 7 05:56:44 2016
> > New Revision: 283537
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=
Author: dergachev
Date: Sat Oct 8 05:53:00 2016
New Revision: 283660
URL: http://llvm.org/viewvc/llvm-project?rev=283660&view=rev
Log:
[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"
The parent commit (r283092) was reverted before and now finally landed.
Modified:
cfe/tr
Author: dergachev
Date: Sat Oct 8 05:54:30 2016
New Revision: 283661
URL: http://llvm.org/viewvc/llvm-project?rev=283661&view=rev
Log:
[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"
The parent commit (r283092) was reverted before and now finally landed.
Added:
cfe/trunk/test
Author: dergachev
Date: Sat Oct 8 06:07:21 2016
New Revision: 283662
URL: http://llvm.org/viewvc/llvm-project?rev=283662&view=rev
Log:
[analyzer] Fix build error after r283660 - remove constexpr strings.
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
Modified: cfe/trun
NoQ added a comment.
In https://reviews.llvm.org/D25326#565919, @danielmarjamaki wrote:
> Ideally it would be possible to run clang-format on the files before
> committing. but currently I get lots of unrelated changes then.
>
> Would it be ok to run clang-format on some files to clean up the fo
NoQ created this revision.
NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun, a.sidorin, alexfh.
NoQ added a subscriber: cfe-commits.
Herald added subscribers: mgorny, beanz.
ASTMatchers are sometimes handy in the Analyzer, and there are more patches to
make use of them.
However, it turns out
NoQ added a comment.
In https://reviews.llvm.org/D25429#565939, @xazax.hun wrote:
> I might be confused, but as far as I remember, when you do static linking,
> symbols tend to be linked in lazily. So as long as you do not use the
> matchers, those numbers might be misleading.
Yep, i did actu
our builders:
http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/21910
Please have a look at it.
Thanks
Galina
On Fri, Oct 7, 2016 at 4:26 AM, Artem Dergachev via cfe-commits
mailto:cfe-commits@lists.llvm.org>> wrote:
Author: dergachev
Date: Fri Oct 7 06:26:1
NoQ added a comment.
Yay, thanks for posting this! :)
I've got a bit of concern for some assert-suppressions.
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:2314
{
+ // Return to fulfil assert condition
+ if (location.getAs())
Hmm. Why would anybody try
NoQ added a reviewer: a.sidorin.
NoQ added a comment.
This looks familiar, i think i've seen significant slowdowns around there on
some very rare files. Nice catch! Probably a binary-search insert could have
also been much better than re-sorting, even if it's still a vector.
Repository:
rL L
NoQ accepted this revision.
NoQ added a comment.
In https://reviews.llvm.org/D25503#569046, @a.sidorin wrote:
> Did you test Artem's approach?
I don't think this is necessary, the priority queue looks like "the" data
structure to use here.
Repository:
rL LLVM
https://reviews.llvm.org/D255
Author: dergachev
Date: Thu Oct 13 06:41:12 2016
New Revision: 284112
URL: http://llvm.org/viewvc/llvm-project?rev=284112&view=rev
Log:
[analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.
AST matchers are useful for the analyzer's checkers.
More patches on particular checkers shall follo
Author: dergachev
Date: Mon Nov 27 09:31:16 2017
New Revision: 319055
URL: http://llvm.org/viewvc/llvm-project?rev=319055&view=rev
Log:
[analyzer] pr34404: Fix a crash on modeling pointers to indirect members.
We were crashing whenever a C++ pointer-to-member was taken, that was pointing
to a mem
Author: dergachev
Date: Mon Nov 27 09:37:09 2017
New Revision: 319058
URL: http://llvm.org/viewvc/llvm-project?rev=319058&view=rev
Log:
[analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor.
We didn't support the following syntax:
(std::initializer_list){12}
which sudd
Author: dergachev
Date: Tue Dec 5 09:14:39 2017
New Revision: 319793
URL: http://llvm.org/viewvc/llvm-project?rev=319793&view=rev
Log:
[analyzer] Mark heap-based symbolic regions in debug dumps.
They are now printed as HeapSymRegion{$x} in order to discriminate between that
and regular SymRegion
Author: dergachev
Date: Mon Dec 11 18:27:55 2017
New Revision: 320451
URL: http://llvm.org/viewvc/llvm-project?rev=320451&view=rev
Log:
[analyzer] In getSVal() API, disable auto-detection of void type as char type.
This is a follow-up from r314910. When a checker developer attempts to
dereference
Author: dergachev
Date: Mon Dec 11 18:59:09 2017
New Revision: 320455
URL: http://llvm.org/viewvc/llvm-project?rev=320455&view=rev
Log:
[analyzer] StackAddrEscape: For now, disable the new async escape checks.
The new check introduced in r318705 is useful, but suffers from a particular
class of f
haoNoQ wrote:
LGTM, thanks!! I have a couple nitpicks but I don't think they should block
your progress.
https://github.com/llvm/llvm-project/pull/69985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/69985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/69985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -77,14 +77,53 @@ class RefCntblBaseVirtualDtorChecker
(AccSpec == AS_none && RD->isClass()))
return false;
- std::optional RefCntblBaseRD =
isRefCountable(Base);
- if (!RefCntblBaseRD || !(*RefCntblBaseRD))
+ auto hasRef
@@ -77,14 +77,53 @@ class RefCntblBaseVirtualDtorChecker
(AccSpec == AS_none && RD->isClass()))
return false;
- std::optional RefCntblBaseRD =
isRefCountable(Base);
- if (!RefCntblBaseRD || !(*RefCntblBaseRD))
+ auto hasRef
haoNoQ wrote:
(You still need me to merge right? You can ask me to merge, or you can address
nitpicks and then ask me to merge, or you can go through
https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access and merge
yourself!)
https://github.com/llvm/llvm-project/pull/69985
___
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/69985
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1028,6 +1028,50 @@ class UPCPreIncrementGadget : public FixableGadget {
}
};
+// Representing a pointer type expression of the form `Ptr += n` in an
+// Unspecified Untyped Context (UUC):
+class UUCAddAssignGadget : public FixableGadget {
+private:
+ static constexpr co
https://github.com/haoNoQ commented:
Very nice!!
https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1028,6 +1028,50 @@ class UPCPreIncrementGadget : public FixableGadget {
}
};
+// Representing a pointer type expression of the form `Ptr += n` in an
+// Unspecified Untyped Context (UUC):
+class UUCAddAssignGadget : public FixableGadget {
+private:
+ static constexpr co
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Thanks for catching these!
I wonder what would it take to delete the copy constructors on these classes,
so that these mistakes are never made again.
https://github.com/llvm/llvm-project/pull/75060
___
cfe-commits mailing list
cfe-commi
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/75060
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \
+// RUN:-fsafe-buffer-usage-suggestions \
+// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+void foo(int * , int *);
+
+void add_assign_test(unsigned int n, int *a, int y)
@@ -1766,6 +1815,52 @@ fixUPCAddressofArraySubscriptWithSpan(const
UnaryOperator *Node) {
FixItHint::CreateReplacement(Node->getSourceRange(), SS.str())};
}
+std::optional
+UUCAddAssignGadget::getFixits(const Strategy &S) const {
+ DeclUseList DREs = getClaimedVarUseSi
https://github.com/haoNoQ commented:
Yay I like this!
https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1312,21 +1353,29 @@ PointerInitGadget::getFixits(const Strategy &S) const {
return std::nullopt;
}
+static bool isNonNegativeIntegerExpr(const Expr *Expr, const VarDecl *VD,
+ const ASTContext &Ctx) {
+ if (auto ConstVal = Expr->getIn
haoNoQ wrote:
Hmm, it really worries me that `MallocChecker` is setting a return value
outside of `evalCall()`. This can easily lead to conflicts if multiple checkers
try to do this: `evalCall()` is protected from conflicts (the engine asserts
that at most one checker evaluates each call) but
@@ -266,13 +266,18 @@ void CheckUseZeroAllocated1(void) {
}
char CheckUseZeroAllocated2(void) {
+ // FIXME: The return value of `alloca()` is modeled with `AllocaRegion`
+ // instead of `SymbolicRegion`, so the current implementation of
+ // `MallocChecker::checkUseZeroAllo
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \
+// RUN:-fsafe-buffer-usage-suggestions \
+// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+void foo(int * , int *);
+
+void add_assign_test(unsigned int n, int *a, int y)
https://github.com/haoNoQ commented:
Aha, yes, this is exactly what I had in mind with the fix-around-it thing!
I found one more nitpick, but I think everything else looks great!
https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1766,6 +1812,48 @@ fixUPCAddressofArraySubscriptWithSpan(const
UnaryOperator *Node) {
FixItHint::CreateReplacement(Node->getSourceRange(), SS.str())};
}
+std::optional
+UUCAddAssignGadget::getFixits(const Strategy &S) const {
+ DeclUseList DREs = getClaimedVarUseSi
Author: Artem Dergachev
Date: 2023-12-13T18:09:16-08:00
New Revision: ef3f476097c7a13c0578e331e44b584b706089ed
URL:
https://github.com/llvm/llvm-project/commit/ef3f476097c7a13c0578e331e44b584b706089ed
DIFF:
https://github.com/llvm/llvm-project/commit/ef3f476097c7a13c0578e331e44b584b706089ed.dif
https://github.com/haoNoQ approved this pull request.
Perfect, thanks!!
https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Pierre d'Herbemont
Date: 2022-03-28T15:08:47-07:00
New Revision: c8048c7c42ffd1731149b0abe15b9081dd27c789
URL:
https://github.com/llvm/llvm-project/commit/c8048c7c42ffd1731149b0abe15b9081dd27c789
DIFF:
https://github.com/llvm/llvm-project/commit/c8048c7c42ffd1731149b0abe15b9081dd27c789.
Author: Artem Dergachev
Date: 2022-02-17T10:13:34-08:00
New Revision: e0e174845b08b36a3888f47f6b06e496f75cf847
URL:
https://github.com/llvm/llvm-project/commit/e0e174845b08b36a3888f47f6b06e496f75cf847
DIFF:
https://github.com/llvm/llvm-project/commit/e0e174845b08b36a3888f47f6b06e496f75cf847.dif
Author: Artem Dergachev
Date: 2022-04-28T17:17:05-07:00
New Revision: f68c0a2f58e484f008883ab290e36a36e851c1bf
URL:
https://github.com/llvm/llvm-project/commit/f68c0a2f58e484f008883ab290e36a36e851c1bf
DIFF:
https://github.com/llvm/llvm-project/commit/f68c0a2f58e484f008883ab290e36a36e851c1bf.dif
Author: Usama Hameed
Date: 2022-05-18T14:35:12-07:00
New Revision: dd7233bc67e45106c4625df7d20391798f31d4a7
URL:
https://github.com/llvm/llvm-project/commit/dd7233bc67e45106c4625df7d20391798f31d4a7
DIFF:
https://github.com/llvm/llvm-project/commit/dd7233bc67e45106c4625df7d20391798f31d4a7.diff
https://github.com/haoNoQ approved this pull request.
Yeah nuke it.
https://github.com/llvm/llvm-project/pull/86953
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80768
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,86 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
+// expected-no-diagnostics
+
+template
+class Ref {
haoNoQ wrote:
It looks like you're copying this definition in every pull request. Can you put
it
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/80810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/80919
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/80934
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/80956
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/80919
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80919
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80934
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80956
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/68170
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Closing because of the other PR.
https://github.com/llvm/llvm-project/pull/68170
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Ok I'll try to land!
https://github.com/llvm/llvm-project/pull/80371
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80371
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -282,8 +282,8 @@ isInUnspecifiedPointerContext(internal::Matcher
InnerMatcher) {
//(i.e., computing the distance between two pointers); or ...
auto CallArgMatcher =
- callExpr(forEachArgumentWithParam(InnerMatcher,
- hasPointerType() /* array
@@ -70,6 +70,15 @@ class UncountedCallArgsChecker
// or std::function call operator).
unsigned ArgIdx = isa(CE) &&
isa_and_nonnull(F);
+ if (auto *MemberCallExpr = dyn_cast(CE)) {
+auto *E = MemberCallExpr->getImplicitObjectArgument();
+auto *
@@ -183,6 +196,22 @@ class UncountedCallArgsChecker
Report->addRange(CallArg->getSourceRange());
BR->emitReport(std::move(Report));
}
+
+ void reportBugOnThis(const Expr *CallArg) const {
+assert(CallArg);
+
+SmallString<100> Buf;
+llvm::raw_svector_ostre
@@ -118,6 +118,26 @@ bool isCtorOfRefCounted(const clang::FunctionDecl *F) {
|| FunctionName == "Identifier";
}
+bool isReturnValueRefCounted(const clang::FunctionDecl *F) {
+ assert(F);
+ auto *type = F->getReturnType().getTypePtrOrNull();
+ while (type) {
+if
@@ -282,8 +282,8 @@ isInUnspecifiedPointerContext(internal::Matcher
InnerMatcher) {
//(i.e., computing the distance between two pointers); or ...
auto CallArgMatcher =
- callExpr(forEachArgumentWithParam(InnerMatcher,
- hasPointerType() /* array
https://github.com/haoNoQ approved this pull request.
Great! Needs a rebase now though.
https://github.com/llvm/llvm-project/pull/81400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/81580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -189,18 +202,16 @@ class UncountedLocalVarsChecker
dyn_cast_or_null(Ref->getFoundDecl())) {
const auto *MaybeGuardianArgType =
MaybeGuardian->getType().getTypePtr();
- if (!MaybeGuardianArgType)
-return;
-
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82229
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -305,19 +337,21 @@ class TrivialFunctionAnalysisVisitor
}
bool VisitDeclRefExpr(const DeclRefExpr *DRE) {
-if (auto *decl = DRE->getDecl()) {
- if (isa(decl))
-return true;
- if (isa(decl))
-return true;
- if (auto *VD = dyn_cast(decl)
https://github.com/haoNoQ approved this pull request.
LGTM!
I think we have to look at the `DeclRefExpr` case more closely - something
seems fishy about it, but also this isn't this patch's fault.
https://github.com/llvm/llvm-project/pull/82229
___
c
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82305
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -95,11 +103,136 @@ tryToFindPtrOrigin(const Expr *E, bool
StopAtFirstRefCountedObj) {
return {E, false};
}
+bool isGuardedScopeEmbeddedInGuardianScope(const VarDecl *Guarded,
+ const VarDecl *MaybeGuardian) {
+ assert(Guarded);
https://github.com/haoNoQ commented:
Hi, looks like I never got to properly review this one! I don't have major
objections but I have some things to consider fixing in follow-up patches.
https://github.com/llvm/llvm-project/pull/82305
___
cfe-commits
@@ -27,6 +28,13 @@ tryToFindPtrOrigin(const Expr *E, bool
StopAtFirstRefCountedObj) {
E = tempExpr->getSubExpr();
continue;
}
+if (auto *DRE = dyn_cast(E)) {
+ auto *decl = DRE->getFoundDecl();
haoNoQ wrote:
Is this really better than
haoNoQ wrote:
Oh right right right, so it's closed without committing, nvm then!
https://github.com/llvm/llvm-project/pull/82305
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
I just thought two PRs, accepted 1, then there were 0 left, and I was confused
😅
https://github.com/llvm/llvm-project/pull/82305
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
https://github.com/haoNoQ approved this pull request.
LGTM, looks straightforward!
https://github.com/llvm/llvm-project/pull/82291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Hi! I wonder if path-sensitive analysis is useful here at all. If you simply
warn every time you see arithmetic performed on a pointer to a class with at
least one virtual method, wouldn't that be quite accurate most of the time?
At a glance, such operation only makes sense when
haoNoQ wrote:
Yes I like this perspective: "Schrödinger's need-for-pre-commit-approval" isn't
a great way to communicate 😅 I'll be more clear in the future.
https://github.com/llvm/llvm-project/pull/80371
___
cfe-commits mailing list
cfe-commits@lists
@@ -171,6 +151,24 @@ class UncountedLocalVarsChecker
std::optional IsUncountedPtr = isUncountedPtr(ArgType);
if (IsUncountedPtr && *IsUncountedPtr) {
+
+ ASTContext &ctx = V->getASTContext();
+ for (DynTypedNodeList ancestors = ctx.getParents(*V); !ancestors.
@@ -70,15 +71,27 @@ bool isSingleton(const FunctionDecl *F);
class TrivialFunctionAnalysis {
public:
/// \returns true if \p D is a "trivial" function.
- bool isTrivial(const Decl *D) const { return isTrivialImpl(D, TheCache); }
+ bool isTrivial(const Decl *D) const {
+
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82229
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
401 - 500 of 1254 matches
Mail list logo