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

Jessica Paquette via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 23:14:40 PDT 2017


paquette added inline comments.


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h:201
+  /// comparison)?
+  bool isGreaterOrEqual(const Expr *E, unsigned long long Val);
+
----------------
Maybe something like

```
/// Returns true if the value of \p E is greater than or equal to \p Val under unsigned comparison.
```


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h:203
+
+  /// \brief Is value of expression negative?
+  bool isNegative(const Expr *E);
----------------
This shouldn't need a \brief, since it's a single line comment.

It could also be something like

```
/// Returns true if the value of \p E is negative.
```


================
Comment at: lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:138
+
+        OS << " larger or equal to the width of type '"
+           << B->getLHS()->getType().getAsString() << "'.";
----------------
Maybe "greater than or equal to" instead of "larger or equal to" just for convention? I hear/read that more often, so seeing "larger" is a little weird.

Minor point though, so if it makes the message too long it doesn't matter.


Repository:
  rL LLVM

https://reviews.llvm.org/D30295





More information about the cfe-commits mailing list