================
@@ -447,6 +447,19 @@ class CIRGenModule : public CIRGenTypeCache {
   llvm::DenseMap<mlir::Attribute, cir::GlobalOp> constantStringMap;
   llvm::DenseMap<const UnnamedGlobalConstantDecl *, cir::GlobalOp>
       unnamedGlobalConstantDeclMap;
+  llvm::DenseMap<const CompoundLiteralExpr *, cir::GlobalOp>
+      emittedCompoundLiterals;
+
+  cir::GlobalOp
+  getAddrOfConstantCompoundLiteralIfEmitted(const CompoundLiteralExpr *e) {
+    return emittedCompoundLiterals.lookup(e);
+  }
+  void setAddrOfConstantCompoundLiteral(const CompoundLiteralExpr *e,
+                                        cir::GlobalOp gv) {
+    bool ok = emittedCompoundLiterals.insert({e, gv}).second;
+    (void)ok;
----------------
andykaylor wrote:

```suggestion
    [[maybe_unused]] bool ok = emittedCompoundLiterals.insert({e, gv}).second;
```

https://github.com/llvm/llvm-project/pull/201152
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to