[clang] [CIR] Introduce LocalInitOp, & lower static locals (PR #193576)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 23:57:50 PDT 2026


================
@@ -371,6 +371,45 @@ LogicalResult cir::BreakOp::verify() {
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// LocalInitOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult cir::LocalInitOp::verify() {
+  if (!getOperation()->getParentOfType<FuncOp>())
+    return emitOpError("must be inside of a function");
+
+  if (getStaticLocal() && getTls())
+    return emitOpError("cannot be both static and thread local");
+
+  if (!getStaticLocal() && !getTls())
+    return emitOpError("must be one of static and thread local");
----------------
xlauko wrote:

after enum no need for verify at all

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


More information about the cfe-commits mailing list