ASDenysPetrov updated this revision to Diff 398986.
ASDenysPetrov added a comment.
Improved the checker. Reworked tests.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114718/new/
https://reviews.llvm.org/D114718
Files:
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/l
ASDenysPetrov added a comment.
@steakhal Thanks! I appreciate your comprehensive comment! I'll take everything
you suggested into account.
Comment at:
clang/test/Analysis/Checkers/StrictAliasingChecker/strict-aliasing.cpp:2
+// RUN: %clang_cc1 -std=c++20 -analyze -analyzer-co
steakhal added a comment.
I haven't checked the code, but only the tests and expectations for scalar
values.
I'll dive deeper if we settled on those.
A couple of remarks:
1. I would rather use top-level function parameters of the given type instead
of declaring an instance of that type and tak
ASDenysPetrov updated this revision to Diff 394290.
ASDenysPetrov added a comment.
Changed handler `check::` functions. Reworked. Covered more cases.
Several cases left (marked as FIXME in the test file). For the glance some of
them we can't handle because of (possibly) wrong symbolic modeling.
ASDenysPetrov added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StrictAliasingChecker.cpp:113
+ QualType getOriginalType(CheckerContext &C, SVal V, QualType T) const {
+assert(V.getAs() && "Location shall be a Loc.");
+V = C.getState()->getSVal(V.castA
ASDenysPetrov updated this revision to Diff 392821.
ASDenysPetrov added a comment.
Improved dynamic type recognition. Provided `-fstrict-aliasing` compiler flag
dependency.
Still has issues with some cases (see it at the bottom of the test file). WIP.
CHANGES SINCE LAST ACTION
https://reviews
ASDenysPetrov added a comment.
@xazax.hun Updated the summary for better undersanding differencies between
the Standards.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114718/new/
https://reviews.llvm.org/D114718
ASDenysPetrov added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StrictAliasingChecker.cpp:48-49
+ //
+ // NOTE: User must provide canonical and unqualified QualType's for the
+ // correct result.
+ static bool canAccess(QualType From, QualType To, ASTContex
xazax.hun added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/StrictAliasingChecker.cpp:58
+ : From(From), To(To), Ctx(Ctx) {}
+ bool canAccessImpl() {
+return isSame() || isCharOrByte() || isOppositeSign();
I'd love to see some detaile
NoQ added a comment.
Awesome, I love it!
What would it take to enable this by default? Note that we can enable the
checker without emitting any warnings; sinking exotic execution paths (on which
strict aliasing is known to be violated) is valuable on its own.
Other than that, we'll probably ne
ASDenysPetrov added a comment.
@rsmith, @aaron.ballman I kindly invite you to join the review process
especially in a part of the Standard interpretation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114718/new/
https://reviews.llvm.org/D114718
ASDenysPetrov created this revision.
ASDenysPetrov added reviewers: rsmith, martong, NoQ, vsavchenko, steakhal,
aaron.ballman, xazax.hun, Szelethus.
ASDenysPetrov added a project: clang.
Herald added subscribers: manas, jeroen.dobbelaere, dkrupp, donat.nagy,
mikhail.ramalho, a.sidorin, rnkovacs,
12 matches
Mail list logo