https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94669
Bug ID: 94669
Summary: libcc1/libcc1.cc; 2 * minor performance problem
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
cppcheck says:
1.
trunk.git/libcc1/libcc1.cc:112:57: performance: Function parameter
'driver_filename' should be passed by const reference. [passedByValue]
Source code is
compiler_driver_filename (libcc1 *self, std::string driver_filename)
Maybe better code
compiler_driver_filename (libcc1 *self, const std::string &
driver_filename)
2.
trunk.git/libcc1/libcc1.cc:96:56: performance: Function parameter
'triplet_regexp' should be passed by const reference. [passedByValue]
compiler_driver_filename (libcc1 *self, std::string driver_filename)
Duplicate.
In a similar position:
trunk.git/libcc1/libcp1.cc:114:57: performance: Function parameter
'driver_filename' should be passed by const reference. [passedByValue]
and
trunk.git/libcc1/libcp1.cc:98:56: performance: Function parameter
'triplet_regexp' should be passed by const reference. [passedByValue]