[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-14 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added a comment. In https://reviews.llvm.org/D45774#1088453, @NoQ wrote: > Two questions for the future: > > - Should we skip the initializer binding for local variables (and > fields/elements of local variables) entirely? Cause we can load from them > anyway. And keeping the Store smal

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1642-1645 +// Return unknown value if index is out of bounds. +if (i < 0 || i >= InitList->getNumInits()) { + return UnknownVal(); +}

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-04 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331556: [analyzer] Treat more const variables and fields as known contants. (authored by dergachev, committed by ). Repository: rC Clang https://reviews.llvm.org/D45774 Files: lib/StaticAnalyzer/Cor

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Two questions for the future: - Should we skip the initializer binding for local variables (and fields/elements of local variables) entirely? Cause we can load from them anyway. And keeping the Store small might be good for performance. - Just in case, do you accidentally

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Yup, thanks! I'll commit. https://reviews.llvm.org/D45774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-04 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added inline comments. Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1723 +if (const InitListExpr *InitList = dyn_cast(Init)) { + if (const Expr *FieldInit = InitList->getInit(FD->getFieldIndex())) { +if (Optional V = svalBuilder.getCons

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-05-04 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl updated this revision to Diff 145156. r.stahl marked 3 inline comments as done. r.stahl added a comment. addressed the comments, thanks! If it looks good, please commit for me. https://reviews.llvm.org/D45774 Files: lib/StaticAnalyzer/Core/RegionStore.cpp lib/StaticAnalyzer/Core/SV

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-04-20 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added inline comments. Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1720 +// Either the record variable or the field has to be const qualified. +if (RecordVarTy.isConstQualified() || Ty.isConstQualified()) { + if (const Expr *Init = VD->getIni

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-04-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Looks great, thanks! > CXXDynamicCastExpr: I don't think evalCast would handle this correctly, does > it? Seems so. It is partially supported by `StoreManager::attemptDownCast()`. I also see relatively little urgency in handling it here because the whole point of `dynamic

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-04-18 Thread Henry Wong via Phabricator via cfe-commits
MTC added a comment. Test files for `initialization` missing? : ) Repository: rC Clang https://reviews.llvm.org/D45774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-04-18 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added a comment. Not sure how to proceed about these: - CXXDynamicCastExpr: I don't think evalCast would handle this correctly, does it? - ObjCBridgedCastExpr: I don't know ObjectiveC - CastKinds for floating point: Floats cannot yet be handled by the analyzer, right? Repository: rC

[PATCH] D45774: [analyzer] cover more cases where a Loc can be bound to constants

2018-04-18 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl created this revision. r.stahl added reviewers: NoQ, dcoughlin, xazax.hun. Herald added subscribers: cfe-commits, a.sidorin, rnkovacs, szepet, mehdi_amini. Herald added a reviewer: george.karpenkov. - SValBuilder::getConstantVal stopped processing an initialization if there are intermedia