[clang] [ObjC] Emit number, array, and dictionary literals as constants (PR #185130)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 6 16:55:11 PST 2026


================
@@ -125,21 +151,22 @@ class ObjCBoolLiteralExpr : public Expr {
 /// as in: @(strdup("hello world")), @(random()) or @(view.frame)
 /// Also used for boxing non-parenthesized numeric literals;
 /// as in: @42 or \@true (c++/objc++) or \@__objc_yes (c/objc).
-class ObjCBoxedExpr : public Expr {
+class ObjCBoxedExpr final : public ObjCObjectLiteral {
   Stmt *SubExpr;
   ObjCMethodDecl *BoxingMethod;
   SourceRange Range;
 
 public:
   friend class ASTStmtReader;
 
-  ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method, SourceRange R)
-      : Expr(ObjCBoxedExprClass, T, VK_PRValue, OK_Ordinary), SubExpr(E),
-        BoxingMethod(method), Range(R) {
+  ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method, bool ECI,
----------------
ojhunt wrote:

Given you're changing the line, would you mind replacing `method` with `Method`?

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


More information about the cfe-commits mailing list