[LLVMbugs] [Bug 12215] New: Add constant Objective-C literals for arrays and dictionaries

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 9 03:51:35 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=12215

             Bug #: 12215
           Summary: Add constant Objective-C literals for arrays and
                    dictionaries
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: clang at nschmidt.name
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The current implementation of Objective-C array and dictionary literals is
syntactic sugar and calls a well known constructor.
I am suggesting a second form that can be used when all members of the literal
are constants. In that case I can have a constant dictionary laid out in memory
without the need to set it up at runtime, pretty much like the constant string
literal.

Those can be used as globals for something like default values:

static NSDictionary *defaults = @{ @"someKey" : @"someValue" };

I guess that would require CFConstantDictionary and CFConstantArray class, but
CoreFoundation/Foundation could provide that as it does with the methods for
the new subscript operators.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list