[PATCH] D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width

Anna Zaks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 10 11:06:24 PDT 2017


zaks.anna added inline comments.


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h:46
 
-} // end GR namespace
+bool isExprResultConformsComparisonRule(CheckerContext &C,
+                                        BinaryOperatorKind CompRule,
----------------
NoQ wrote:
> Because you are making these functions public, i think it's worth it to make it obvious what they do without looking at the particular checker code. Comments are definitely worth it. I think function names could be worded better; i suggest `exprComparesTo(const Expr *LHSExpr, BinaryOperatorKind ComparisonOp, SVal RHSVal, CheckerContext &C);` and `isGreaterOrEqual(...)`; i'm personally fond of having CheckerContext at the back because that's where we have it in checker callbacks, but that's not important.
+ 1 on Artem's comment of making the names more clear and providing documentation. Also, should these be part of CheckerContext?


Repository:
  rL LLVM

https://reviews.llvm.org/D30295





More information about the cfe-commits mailing list