[clang] [CIR] Add if statement support (PR #134333)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 14:57:41 PDT 2025


================
@@ -1484,6 +1484,20 @@ mlir::Value ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *e) {
   return {};
 }
 
+/// If the specified expression does not fold
+/// to a constant, or if it does but contains a label, return false.  If it
+/// constant folds return true and set the boolean result in Result.
+bool CIRGenFunction::constantFoldsToSimpleInteger(const Expr *cond,
----------------
andykaylor wrote:

Can you rename this to `constantFoldsToBool` and move it to the same file as the other `constantFoldsToInteger` implementation?

https://github.com/llvm/llvm-project/pull/134333


More information about the cfe-commits mailing list