<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - CodeGenMapTable can fail to delete duplicate ColFieldValueMap entries"
   href="https://llvm.org/bugs/show_bug.cgi?id=26196">26196</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CodeGenMapTable can fail to delete duplicate ColFieldValueMap entries
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>TableGen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stephen.montgomery333@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, stoklund@2pi.dk
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>