[clang] [CIR] Lowering to LLVM for global pointers (PR #125619)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 09:49:15 PST 2025


================
@@ -84,6 +138,19 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite(
   SmallVector<mlir::NamedAttribute> attributes;
 
   if (init.has_value()) {
+    auto setupRegionInitializedLLVMGlobalOp = [&]() {
----------------
andykaylor wrote:

It's not quite as bad there because everything is coming from the `op` object. It was worse here because of all the placeholders for things the `op` doesn't have yet here. Still the incubator implementation retrieves a lot of this in multiple places and only calls the function in this scope.

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


More information about the cfe-commits mailing list