<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/94373>94373</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang/utils/TableGen/ClangOptionDocEmitter.cpp:220: Pointless string copy ?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            tablegen,
            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:

clang/utils/TableGen/ClangOptionDocEmitter.cpp:220:41: performance: Function parameter 'Heading' should be passed by const reference. [passedByValue]

Source code is

void emitHeading(int Depth, std::string Heading, raw_ostream &OS) {

Maybe better code:

void emitHeading(int Depth, const std::string & Heading, raw_ostream &OS) {

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykUk1vnDwQ_jXDZZSVGcOye-CwHy9vL1Uqpeq1GswE3BpMbZOKf1-xidIol1bqxZY99vOlh2O0_SRSQ3mG8prxkgYf6s60Oi-y1ndr_ZA4WYM8sVujBDTzbAYx3zHyGkGfQF1BvazG8dQDNUuyLgI1n7l18r9MQM1lG93Pyfrp6s1_o01Jws7MM-gTkQJ9KnLQJ5wlPPow8mRkOzbLZLY_OHPgUZIEBKo-CHd2Y6owDn5xHbaCM8coHbYrGj_FhEEeJchkZIdQnp-n5_ULu0WgvL6V_eCXYASN7wRtfDt58rZDGW16ZTzYKeFV5jQAXTCmbotAn2IKdurx9dkFA__86mMKwiMC7e8fgI4I1fkt_EdeW8FWtixu9O_y_BP9s9H3IoD2fy8k62rdHfWRM6nzKq_K_KA0ZUPdlVWuOsO5FpWbkvMDKcN5zsaU6kBtZmtSVKi9KvI9KZ3vpCXDj3stWnHFdIRCycjW7Zx7Gnc-9JmNcZH6WOhKZ45bcfFWPKK0FaXfikJAFyDawrj7sbCzad0uy2sW6g3nrl36CIVyNqb4GznZ5KT-p_7hJ2-n5CRGfAnS-HlF0E22BFcPKc23vlMD1PQ2DUu7M34EajYVL9vdHPw3MQmouZndVDz7farpVwAAAP__m-QWZA">