summaryrefslogtreecommitdiff
path: root/libcc1/compiler.cc
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-05-04 15:26:58 -0600
committerTom Tromey <tom@tromey.com>2021-05-05 00:08:52 -0600
commit61d48b1e2b5bae1e0e5e48af296facd61617139c (patch)
tree7bae3f163d378f0bbfa8a746be573ee60f35044b /libcc1/compiler.cc
parent96deddca2e535d09db1d244a96a1efc20e24b673 (diff)
downloadgcc-61d48b1e2b5bae1e0e5e48af296facd61617139c.tar.gz
libcc1: avoid a call to c_str
This is a trivial change to libcc1 to avoid an explicit call to c_str. Passing by const reference is slightly less wordy. libcc1 * compiler.cc (make_regexp): Take const std::string. (cc1_plugin::compiler_triplet_regexp::find): Update.
Diffstat (limited to 'libcc1/compiler.cc')
-rw-r--r--libcc1/compiler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcc1/compiler.cc b/libcc1/compiler.cc
index fede8496862..a12843c538a 100644
--- a/libcc1/compiler.cc
+++ b/libcc1/compiler.cc
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
// Construct an appropriate regexp to match the compiler name.
static std::string
-make_regexp (const char *triplet_regexp, const char *compiler)
+make_regexp (const std::string &triplet_regexp, const char *compiler)
{
std::stringstream buf;
@@ -71,7 +71,7 @@ char *
cc1_plugin::compiler_triplet_regexp::find (const char *base,
std::string &compiler) const
{
- std::string rx = make_regexp (triplet_regexp_.c_str (), base);
+ std::string rx = make_regexp (triplet_regexp_, base);
if (verbose)
fprintf (stderr, _("searching for compiler matching regex %s\n"),
rx.c_str());