[clang] 8dbfe83 - [CIR] Fix mlir::ValueRange init from ArrayRef warning (#146577)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 1 11:32:07 PDT 2025


Author: Amr Hesham
Date: 2025-07-01T20:32:04+02:00
New Revision: 8dbfe83681ed2066b3591be24c4a566b87177d12

URL: https://github.com/llvm/llvm-project/commit/8dbfe83681ed2066b3591be24c4a566b87177d12
DIFF: https://github.com/llvm/llvm-project/commit/8dbfe83681ed2066b3591be24c4a566b87177d12.diff

LOG: [CIR] Fix mlir::ValueRange init from ArrayRef warning (#146577)

Fix initalizing ValueRange with ArrayRef
`ValueRange(ArrayRef<Value>(std::forward<Arg>(arg))) {}` warning

Added: 
    

Modified: 
    clang/include/clang/CIR/Dialect/IR/CIROps.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 4daff74cbae5a..4d3ebfb93615d 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -489,7 +489,7 @@ def ReturnOp : CIR_Op<"return", [ParentOneOf<["FuncOp", "ScopeOp", "IfOp",
 
   // Allow building a ReturnOp with no return operand.
   let builders = [
-    OpBuilder<(ins), [{ build($_builder, $_state, std::nullopt); }]>
+    OpBuilder<(ins), [{ build($_builder, $_state, {}); }]>
   ];
 
   // Provide extra utility definitions on the c++ operation class definition.


        


More information about the cfe-commits mailing list