[llvm-bugs] [Bug 43891] New: ARMCallingConv.cpp - unnecessary pass by (non-const) by reference

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 3 07:23:41 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=43891

            Bug ID: 43891
           Summary: ARMCallingConv.cpp - unnecessary pass by (non-const)
                    by reference
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org,
                    rnk at google.com, Ties.Stuij at arm.com
            Blocks: 30996

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


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=30996
[Bug 30996] [META] PVS Studio Warnings
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191103/9e66cf78/attachment.html>


More information about the llvm-bugs mailing list