compiler: use const std::string& in a couple of places

Use a reference to avoid copying a std::string.

Fixes https://gcc.gnu.org/PR94766

Change-Id: Icd28fda48a795fe88c82fb7f57c6cfa2c8593f2a
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/233320
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2 files changed