<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108785>108785</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
CommandLine RegisterCodeGenFlags not executing
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
amanuel2
</td>
</tr>
</table>
<pre>
For some reason the codegen::RegisterCodeGenFlags fails to execute, whenever I try ./amanlang --filetype=obj it gives me:
```
❯ ./amanlang --filetype=obj
Begin before
amanlang: Unknown command line argument '--filetype=obj'. Try: './amanlang --help'
amanlang: Did you mean '--emitir=obj'?
```
What is weird is that inspecting the localy built llvm, you see the lines in CommandLine.cpp where it registeres all the options. If I manually just copy paste the `static cl::opt<CodeGenFileType> FileType`, it seems to work fine, but still weird how using codegen::RegisterCodeGenFlags with static storage doesn't do the job.
Reference: https://github.com/amanuel2/llvm-learn/blob/main/aman-lang/tools/driver/Driver.cc#L31
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVF2PnTYQ_TXmZbQIzP3igYfN3lCtlKcoVZ-NPRdmY2xkD_eWf18Z2DRto0YKQpZt7DlnzhxGxUi9Q2zE8YM4XjM18-BDo0blZrQy67xZmtYHiH5ECKiid8ADgvYGe3SiehbV82fsKTKGF2_wN3StVX2EmyIbgT3gn6hnRiFf4DGgwzsGeAUOC-RCtgnKKtfD09ONLPIyoaiuvnsDYujpjhFGTDDFVRTv46nY3235UYr6Kp7bnwT81WdD-YA9Oejw5gNuO-9IonqG391X5x8OtB9H5QxYcggq9POIjkHI87_ZCHnOAb6EJd1Oi39SH9BOQp7_C3QlA4ufYUTltrg4ElP4FlVU7Y9VWsc_BsVAER5IwaQJrxsuTqiZXL8W13qt7ALdTJbB2vuYapdAI-J2gBxGIAcvW7qfyGGupykVOGCqXNgtgRGUteslPzF5F3N4vcErJIcpaxd4myOD9tMCk4q8xRenIrJi0qDtZjE_sahe3g1GFr-sSn6Eb_NTkVgSJ5LjaryHD1_hRm61XjczRCZr99QH_4A5pox_buUH8QA7ocg-qB7BeIxOyDOD8SvnN9_l3yv9GW8Y0OlkXhiYp5gQZCtk2xMPc5drP-5FT_-akG2S-smiCk7ItrO-E7IdFbn91NPqAdmy9zYK2ZpAdwxCttd1kmstZPWpKjPTVKauapVhU57l6XAsqlpmQ3PWx1ofLsYcZIl1d1amQ1N2p7I8Il6KOqNGFvJQ1OWpKKuqlPmluuDFlMWxM_pS1UocChwV2TxRzX3oM4pxxqYsLufLMbOqQxvXZiKlwwesX4WUqbeEZs2vm_soDoWlyPHvMExssfnOTvDDSjjPez8h12dzsM3_KLs5d1N1Cv4NNQvZrpSSfDvneyP_CgAA__-VhJmt">