<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94233>94233</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h:285: Pointless string copy ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AArch64,
code-quality
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h:285:38: performance: Function parameter 'Style' should be passed by const reference. [passedByValue]
Source code is
void setOutliningStyle(std::string Style) { OutliningStyle = Style; }
Maybe better code:
void setOutliningStyle( const std::string & Style) { OutliningStyle = Style; }
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysUzuPnDAQ_jWmGd0KxuaxBQWbFVKKUyJdlN42s-Cc1ya2WYl_H7FHco8iRZQG4flG_h76LGM0oyNqWXli5TmTS5p8aAeteCEy5Ye1fUoyGQ3SSbtGCqDnWU-knyHKNTLesfzM8v1r7e3KsLdGMey_yTBSYth3XdBTJV7_HqWejKN-cToZ7z67iz9MjHfYlIx3vGG8g5nCxYerdJq24-9dmGWQV0oUgGH9lFZLDGuIk1_sAIpgljHSAGoF7V1MEOhCgZymA7Dy9IKe1u_SLsTK81vxT34JmkD7gcDEtwjAzZsBIqUvS7LGGTfuzE1Mw5YB72IKxo2wz4_A6hO83wbGzzvOT8Dqd-SPclUEitLmbJPwIdm_SNiNflTCsPoHNdnQ8uHIjzKjtqiLWmCDVZVNLQ2aY1ELKQqVD8VFSUR-OWJeNIh1IzLTYo4ir3JelCiwOuSiEMOFF0UjdaVzwUROV2nsYWvJwYcxMzEu1B4Fcp5ZqcjGew8RldTP5DY_f7qDDD8xxC2ah5-LtCat27A8Z6HdLnxQyxiZyK2JKb5SJJMstf-ll_DVG5csxQh7xNrPKzDeZ0uw7ZTSfH8P2DPsR5OmRR20v_Pu9JvMOfgfpDf6u_vIsH8J4NbirwAAAP__W5cd1A">