[LLVMbugs] [Bug 2363] New: DenseMap won't work with const key, integer value

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat May 24 11:12:17 PDT 2008


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

           Summary: DenseMap won't work with const key, integer value
           Product: new-bugs
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: viridia at gmail.com
                CC: llvmbugs at cs.uiuc.edu


DenseMap<const Ptr *, int> doesn't work for two reasons:

1) On line 221, the placement new fails because the argument is const.
2) DenseMap<int>::isPod is undefined.

For the former, I'm not sure what to do. For the latter, well, you can't define
DenseMapInfo<int> because there are no available integer sentinel values for
getEmptyKey() - you can't assume -1 is an invalid key. Probably the correct
thing to do is to define a separate type traits class for just those traits
needed by values (not keys). (Or define a whole type traits system, which might
not be a bad idea, it would clean up the current container implementations
quite a bit.)


-- 
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