nickdesaulniers added inline comments.

================
Comment at: clang/lib/Analysis/UninitializedValues.cpp:819-820
+    // semantic analysis passes.
+    while (isa<UnaryOperator>(Ex))
+      Ex = stripCasts(C, dyn_cast<UnaryOperator>(Ex)->getSubExpr());
+
----------------
Q: are there any unary operators that are not casts? For example isn't 
something like `-x` a unary negation operator?  I worry that this could be an 
infinite loop as written.

If this fear is unfounded, then I think the code could be rewritten as:

```
while (const auto *UO = dyn_cast<UnaryOperator>(Ex))
  Ex = stripCasts(C, UO->getSubExpr());
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114848/new/

https://reviews.llvm.org/D114848

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to