majnemer added inline comments.

================
Comment at: lib/CodeGen/CGExprScalar.cpp:3223-3224
+      // crash later.
+      llvm::IntegerType *ResultTy =
+                         dyn_cast<llvm::IntegerType>(Result->getType());
+      if ((ResultTy->getBitWidth() > 1) &&
----------------
Is this clang-format'd ?


================
Comment at: lib/CodeGen/CGExprScalar.cpp:3224
+      llvm::IntegerType *ResultTy =
+                         dyn_cast<llvm::IntegerType>(Result->getType());
+      if ((ResultTy->getBitWidth() > 1) &&
----------------
You are unconditionally dereferencing the result of a dyn_cast. You are either 
missing a null-check or this should be a cast<>


================
Comment at: lib/CodeGen/CGExprScalar.cpp:3225-3226
+                         dyn_cast<llvm::IntegerType>(Result->getType());
+      if ((ResultTy->getBitWidth() > 1) &&
+          (E->getType() == CGF.getContext().BoolTy))
+        Result = Builder.CreateTrunc(Result, Builder.getInt1Ty());
----------------
Extra parens.


https://reviews.llvm.org/D38656



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

Reply via email to