<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107723>107723</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Consolidate `StrCmpOptionName` duplicate functions in OptEmitter.cpp and OptTable.cpp
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jurahul
</td>
</tr>
</table>
<pre>
Both files contain function to do a *almost* case-insensitive lexicographic comparison, but there is one subtle difference:
1. The one in OptTable.cpp considers 2 strings of same length identical if they are identical case-insensitive-ly. The one in OptEmitter.cpp considers such strings as order per their case-sensitive comparison (with a call to strcmp(A,B))
Performance/code wise, the one in OptTable.cpp seems better as it uses StringRef and its API to do most of the work.
This bug is to consolidate the 2 functions to be identical as well as share the functions as well.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0k9Fu6zYMhp9GviFqqLSdxBe-SHsWYDc7Bzt9AVmmbZ7JkiHKzfr2g7ygCToMCCLApPj__CgaEZ48UaeaF9V8K8yW5hC7X1s08-aKPgwf3UtIM4zsSMAGnwx7GDdvEwcPKcAQwIDCs3FLkKTwDNYIPbEX8sKJ3wkc_c02TNGsM1uwYVlNZAle4Sv0W4I0UyRggeAJZOuTIxh4HCmSt6Sqs9LflL79P5fwNtOeyh6-r-nN9I5Ku67ZnvBAUQBBUmQ_CYQRxCzZg5_SDDyQT2yNAx6z7geYLP359av3J_fxVe-3hVOi-EVRNjt_ihqBEAeKsFLMKhz_LXxHcocACk9XTjMYsMa5jFRStMuq8HRW-PqisM2_BwQ_KI4hLibDwYsNA8GVhTLO9D9ohGgR6Ck7z_Y4wSYk8HN3_CeNYPwAnATOP36_jTXPM_PLNa8h_lU-enibWaDfpjy2FHYQwfFgEu35-PlG9nD_yNgIXMntp8wZf75wT7-Fy2LoqqGtWlNQ93zE5lgfjrou5u6A1FQVtppOJ2yqUzvWttHUVm17oEFjwR1qrHWrj4i60XXZ2ueeKqoHxKGpqqOqNS2GXenc-1KGOBUsslH3rI9HrApnenKy7wSipyvsUYWYVyR2-dJTv02iau1YktzLJE6OutcHGOqgf6b4uqzf19zeH2YhddAwbKtjmxPujf_3eeWZPI6x2KLr5pRWyUuBF4WXidO89aUNi8JL9nE7ntYYfpFNCi-7e1F4ubX33uE_AQAA__90E1ki">