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:
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:
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,
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
___
vrnithinkumar marked 2 inline comments as done.
vrnithinkumar added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:483
+llvm::raw_ostream ) {
+
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/
NoQ added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:483
+llvm::raw_ostream ) {
+ 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:
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
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/
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;
vsavchenko added inline comments.
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:404
+void SmartPtrModeling::handleBoolOperation(const CallEvent ,
+ CheckerContext ) const {
I suggest
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.
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 , CheckerContext ) {
+ 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 , CheckerContext ) {
+ 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
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
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
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
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
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
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`
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
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
28 matches
Mail list logo