[llvm-bugs] [Bug 26196] New: CodeGenMapTable can fail to delete duplicate ColFieldValueMap entries

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 18 09:58:23 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26196

            Bug ID: 26196
           Summary: CodeGenMapTable can fail to delete duplicate
                    ColFieldValueMap entries
           Product: tools
           Version: 3.7
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: unassignedbugs at nondot.org
          Reporter: stephen.montgomery333 at gmail.com
                CC: llvm-bugs at lists.llvm.org, stoklund at 2pi.dk
    Classification: Unclassified

There is a loop in emitEnums() (CodeGenMapTable.cpp) whose purpose is to remove
duplicate column field values. I think this loop is wrong because it increments
the loop counter regardless of whether a duplicate value is deleted or not.
When a duplicate _is_ deleted, the next value is skipped. So two duplicate
values is OK but if there are 3 consecutive duplicates, the third one isn't
deleted.

This is a problem, for me at least, because I end up with an enum that has
duplicate enumerators and my instruction mapping code won't compile.

I guess an easy fix would be to decrement j whenever a value is deleted.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160118/63063e30/attachment.html>


More information about the llvm-bugs mailing list