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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
            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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to