================
@@ -2196,6 +2196,58 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr 
*E) {
   return V;
 }
 
+static bool isDeclRefKnownNonNull(CodeGenFunction &CGF, const ValueDecl *D) {
+  return !D->isWeak();
+}
+
+static bool isLValueKnownNonNull(CodeGenFunction &CGF, const Expr *E) {
+  E = E->IgnoreParens();
+
+  if (auto *UO = dyn_cast<UnaryOperator>(E)) {
+    if (UO->getOpcode() == UO_Deref) {
+      return CGF.isPointerKnownNonNull(UO->getSubExpr());
+    }
+  }
+
+  if (auto *DRE = dyn_cast<DeclRefExpr>(E)) {
----------------
kovdan01 wrote:

Nit

```suggestion
  if (const auto *DRE = dyn_cast<DeclRefExpr>(E)) {
```

https://github.com/llvm/llvm-project/pull/100830
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to