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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 07:11:03 PST 2025


================
@@ -55,14 +104,19 @@ struct ConvertCIRToLLVMPass
   StringRef getArgument() const override { return "cir-flat-to-llvm"; }
 };
 
+/// Replace CIR global with a region initialized LLVM global and update
+/// insertion point to the end of the initializer block.
+
 mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite(
     cir::GlobalOp op, OpAdaptor adaptor,
     mlir::ConversionPatternRewriter &rewriter) const {
 
   // Fetch required values to create LLVM op.
   const mlir::Type cirSymType = op.getSymType();
+  const auto loc = op.getLoc();
----------------
erichkeane wrote:

I don't believe this passes our `use of auto` policy here.  Unless the type is named `Loc` :) 

EDIT: Looked, it isnt:

```suggestion
  const Location loc = op.getLoc();
```

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


More information about the cfe-commits mailing list