This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbc3d4d9ed783: [analyzer] Add bool operator modeling for
unque_ptr (authored by vrnithinkumar).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
LG! Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https://reviews.llvm.org/D86027
vrnithinkumar marked an inline comment as done.
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:556
+const LocationContext *LC = C.getLocationContext();
+InnerPointerVal = C.getSValBuilder().conjureSymbolVal(
+
vrnithinkumar updated this revision to Diff 288974.
vrnithinkumar added a comment.
- Fixing minor spacing issue
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https://reviews.llvm.org/D86027
Files:
clang/lib/StaticAnalyzer/Checkers/Sma
vrnithinkumar updated this revision to Diff 288972.
vrnithinkumar added a comment.
- Addressing review comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https://reviews.llvm.org/D86027
Files:
clang/lib/StaticAnalyzer/Checkers/Sma
xazax.hun added inline comments.
Herald added a subscriber: danielkiss.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:556
+const LocationContext *LC = C.getLocationContext();
+InnerPointerVal = C.getSValBuilder().conjureSymbolVal(
+CallExpr, L
NoQ accepted this revision.
NoQ added a comment.
I have no other concerns, i think this is good to go!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https://reviews.llvm.org/D86027
___
cfe-com
vrnithinkumar marked 2 inline comments as done.
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:483
+llvm::raw_ostream &OS) {
+ BR.markInteresting(T
vrnithinkumar updated this revision to Diff 288048.
vrnithinkumar marked an inline comment as done.
vrnithinkumar added a comment.
- Removing unnecessary notetags.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https://reviews.llvm.org/D8
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:483
+llvm::raw_ostream &OS) {
+ BR.markInteresting(ThisRegion);
+ OS << "Smart
vrnithinkumar marked an inline comment as done.
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:494-496
+ OS << "Smart pointer";
+ checkAndPrettyPrintRegion(OS, ThisRegion);
+ OS << " is non-null";
---
vrnithinkumar updated this revision to Diff 287641.
vrnithinkumar added a comment.
- Making the note tags prunable
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https://reviews.llvm.org/D86027
Files:
clang/lib/StaticAnalyzer/Checkers/
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:315-318
+SVal Val = I->second;
+for (auto si = Val.symbol_begin(), se = Val.symbol_end(); si != se; ++si) {
+ SR.markLive(*si);
+}
Yes, this looks corre
vrnithinkumar updated this revision to Diff 287512.
vrnithinkumar marked 11 inline comments as done.
vrnithinkumar added a comment.
- Adding checkLiveSymbols and review comments changes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86027/new/
https
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:137
+ const auto *RecordDecl = MethodDecl->getParent();
+ if (!RecordDecl || !RecordDecl->getDeclContext()->isStdNamespace())
+return InnerType;
xazax.hu
vsavchenko added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:404
+void SmartPtrModeling::handleBoolOperation(const CallEvent &Call,
+ CheckerContext &C) const {
I suggest `BoolCon
xazax.hun requested changes to this revision.
xazax.hun added a comment.
This revision now requires changes to proceed.
Please add a test case, where the unique_ptr is initialized from a pointer
parameter that has no assumptions. I think that case is not handled correctly.
Com
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:130
+// Returns empty type if not found valid inner pointer type.
+static QualType getInnerPointerType(const CallEvent &Call, CheckerContext &C) {
+ QualType InnerType{};
--
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:130
+// Returns empty type if not found valid inner pointer type.
+static QualType getInnerPointerType(const CallEvent &Call, CheckerContext &C) {
+ QualType InnerType{};
vrnithinkumar updated this revision to Diff 286632.
vrnithinkumar marked 5 inline comments as done.
vrnithinkumar added a comment.
Changes to use conjureSymbolVal if the inner pointer value is missing
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:147
-if (!move::isMovedFrom(State, ThisR)) {
- // TODO: Model this case as well. At least, avoid invalidation of
- // globals.
- return false;
+if (Mod
xazax.hun added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:147
-if (!move::isMovedFrom(State, ThisR)) {
- // TODO: Model this case as well. At least, avoid invalidation of
- // globals.
- return false;
+if (ModelSm
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400
+ ProgramStateRef NotNullState, NullState;
+ std::tie(NotNullState, NullState) =
State->assume(CallExprVal.getValue());
+
vrnithinkumar wrote:
> NoQ wrote
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400
+ ProgramStateRef NotNullState, NullState;
+ std::tie(NotNullState, NullState) =
State->assume(CallExprVal.getValue());
+
NoQ wrote:
> It's alwa
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:411
+ if (NotNullState) {
+auto NonNullVal = C.getSValBuilder().makeTruthVal(true);
+NotNullState =
Since the inner pointer value can be a
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400
+ ProgramStateRef NotNullState, NullState;
+ std::tie(NotNullState, NullState) =
State->assume(CallExprVal.getValue());
+
It's always `UnknownVal` because
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:147
-if (!move::isMovedFrom(State, ThisR)) {
- // TODO: Model this case as well. At least, avoid invalidation of
- // globals.
- return false;
+if (Mod
vrnithinkumar created this revision.
Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong,
Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet,
baloghadamsoftware, xazax.hun.
Herald added a project: clang.
vrnithinkumar requested review of this revision.
28 matches
Mail list logo