<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ARMCallingConv.cpp - unnecessary pass by (non-const) by reference"
   href="https://bugs.llvm.org/show_bug.cgi?id=43891">43891</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ARMCallingConv.cpp - unnecessary pass by (non-const) by reference
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: ARM
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org, rnk@google.com, Ties.Stuij@arm.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>30996
          </td>
        </tr></table>
      <p>
        <div>
        <pre>These functions:

f64AssignAPCS, f64AssignAAPCS, f64RetAssign, CC_ARM_APCS_Custom_f64,
CC_ARM_AAPCS_Custom_f64, RetCC_ARM_APCS_Custom_f64, RetCC_ARM_AAPCS_Custom_f64,
CC_ARM_AAPCS_Custom_Aggregate

all take non-constant arguments that are passed by reference:

unsigned &ValNo
MVT &ValVT
MVT &LocVT
CCValAssign::LocInfo &LocInfo

This is causing warnings in PVS Studio including:

ARMCallingConv.cpp::21
ARMCallingConv.cpp::64
ARMCallingConv.cpp::117
ARMCallingConv.cpp::172
V669 The 'ValNo', 'LocInfo' arguments are non-constant references. The analyzer
is unable to determine the position at which this argument is being modified.
It is possible that the function contains an error.

AFAICT none these need to be passed by reference at all (they're basic
integer/enum values) and could be simplified to:

unsigned ValNo
MVT ValVT
MVT LocVT
CCValAssign::LocInfo LocInfo</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [META] PVS Studio Warnings"
   href="https://bugs.llvm.org/show_bug.cgi?id=30996">Bug 30996</a>] [META] PVS Studio Warnings
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>