<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79707>79707</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
flang/lib/Parser/preprocessor.cpp:255: possible performance problem ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
flang/lib/Parser/preprocessor.cpp:255:39: performance: Function parameter 'macro' should be passed by const reference. [passedByValue]
Source code is
void Preprocessor::Define(std::string macro, std::string value) {
definitions_.emplace(SaveTokenAsName(macro), Definition{value, allSources_});
}
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUkk-PmzAQxT_NcLEWgU1COHBINuJYrZSq15U9HhJ3DbY8JlK-fUWStlFvvYDmj3_znvQ0szvPRD1sDrA5FnrJl5B6i0bVTWGCvfWnrLNDoWftb0xJYIx4IfwSrG8Mag_VEarnd_R6PoMcvDMghw-dmBLIISaKKSAxh1RijKD2crMBtVcdqL2IlMaQJj0jreWwzJhdmEXUSU-UKQmQ7aQxBZCt4EtYvBWGRNTMZIW5CQwzZ5FopEQzUilgc3hMD7cf2i8Em-OrzlNYEpLAYEk4fp1cg7Pi40Xv6lDtjzS6mUDuONtHh3Ny81k8Zb2LfwfX-1nZCWgPD7SwK8St1vizpCl6jSvypK_0PXzRvOdvelo7T2i3co9_HkF7eELfhfb-4YE_oT2uq-p5ZS1f_BS2V7ZTnS6or9tqq3aNkl1x6S2prdnpDrsRlbJbHLcKiap222wNWipcLyvZVLVs607tmq5s6kbXVo11YzQRIjQVTdr50vvrVIZ0LhzzQn3btVVbeG3I8z1XUj5zIdeIpX7dfzPLmaGpvOPMfwnZZU_9_8ZIxMDsjKfXKImYgvE0CVBDsSTfX3KO98DKAeRwdvmymBLDtB7y19-_t5jCT8IMcrjbYZDD3dGvAAAA__-7SAMp">