@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -2219,6 +2219,50 @@ def CIR_TrapOp : CIR_Op<"trap", [Terminator]> {
let assemblyFormat = "attr-dict";
}
+//===--===//
+// ArrayCtor
+//===--
@@ -805,4 +805,50 @@ bool CIRGenFunction::shouldNullCheckClassCastValue(const
CastExpr *ce) {
return true;
}
+/// Computes the length of an array in elements, as well as the base
+/// element type and a properly-typed first element pointer.
+mlir::Value
+CIRGenFunction::emi
@@ -2219,6 +2219,50 @@ def CIR_TrapOp : CIR_Op<"trap", [Terminator]> {
let assemblyFormat = "attr-dict";
}
+//===--===//
+// ArrayCtor
+//===--
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142
>From 2a78522d151c3a970fccef94724a31fe14547f9d Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 16 Jul 2025 18:48:52 +0200
Subject: [PATCH 1/4] [CIR] Add support for array constructors
This patch upstreams s
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142
>From 2a78522d151c3a970fccef94724a31fe14547f9d Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 16 Jul 2025 18:48:52 +0200
Subject: [PATCH 1/2] [CIR] Add support for array constructors
This patch upstreams s
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -311,6 +312,115 @@ void CIRGenFunction::emitInitializerForField(FieldDecl
*field, LValue lhs,
assert(!cir::MissingFeatures::requiresCleanups());
}
+/// Emit a loop to call a particular constructor for each of several members
+/// of an array.
+///
+/// \param ctor the co
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
xlauko wrote:
```suggestion
void lowerArrayCtor(cir::ArrayCtor op);
```
ht
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
@@ -2219,6 +2219,42 @@ def CIR_TrapOp : CIR_Op<"trap", [Terminator]> {
let assemblyFormat = "attr-dict";
}
+//===--===//
+// ArrayCtor
+//===--
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public
LoweringPrepareBase {
void runOnOperation() override;
void runOnOp(Operation *op);
+ void lowerArrayCtor(ArrayCtor op);
};
} // namespace
-void LoweringPreparePass::runOnOp(Operation *op) {}
+void LoweringPrep
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/149142
This patch upstreams support for creating arrays of classes that require
calling a constructor.
* Adds the ArrayCtor operation
* New lowering pass for lowering ArrayCtor to a loop
>From 2a78522d151c3a970fccef94724
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Morris Hafner (mmha)
Changes
This patch upstreams support for creating arrays of classes that require
calling a constructor.
* Adds the ArrayCtor operation
* New lowering pass for lowering ArrayCtor to a loop
---
Patch is 24.31 KiB, tru
28 matches
Mail list logo