<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95091>95091</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/include/llvm/Passes/StandardInstrumentations.h:385: Pointless string copy ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
code-quality,
llvm
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
llvm/include/llvm/Passes/StandardInstrumentations.h:385:25: performance: Function parameter 'S' should be passed by const reference. [passedByValue]
Source code is
FuncDataT(std::string S) : EntryBlockName(S) {}
For ISO C++,, const std:: strong & might be better, but for this project, use
of StringRef might be another choice.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysUk1vnDwQ_jXmMsoKhmWBA4fd7IuUy9uoW_U-mAHcGJvaJhL_vjK7StJ7JcuSPaPnY-Yh79VomBtRXERxTWgNk3VNL7s8Oyad7bfmFigoCWRIb54dyGWRE8s38LR5kZ9FehXp49b6fRbYKiP12rPA9vHxSt6zF9jeApmeXP9ifHDrzCaCW-MPk8jPeVWI_IzxgoXdYN1MRnJ8tquRsREWcjRzYAcCy5vAEvxkV91Dx7BElh66DaQ1PoDjgR0byQcQxeVevWw_Sa8siutX3Te7Oskgbc-g_NcK7NRXCvRDYOVDHx3nZx-cMiPcBNYQ9f1ngtsu2sq3_2lmgdW9Ul5E-RdRax283L7Bs8DLfp4FPj_kfoCDD86aEQSeYFbjFKK5jkNgF7u7NcBgHYRJeVic_cUyxP_V853EDnDb9X3n4ROAjA1T3N9kleTDvTXpm7yv85oSbrIyq9K6OmV1MjVd1Wc4cHUqc-qxzEqqqqEkIirxlNZFohpM8Ziesiyt81NRH7hMqTsdqcz6vEYcxDHlmZQ-xAwcrBsT5f3KTV2kdZZo6lj7PXaIce5Pv1fSKmwCcZ8K3qODMZWuiY-nbh29OKZa-eA_UYMKmpt_kTx4tcoEzd7DY7_SLhuIvE1Wp5sphGUPPLYC21GFae0O0s6fZLvKj420u9_Ifbf83uCfAAAA__8rbRZz">