// Set the profile kind using fprofile-instrument-use-path.
static void setPGOUseInstrumentor(CodeGenOptions &Opts,
- const std::string ProfileName) {
+ const Twine &ProfileName) {
auto ReaderOrErr = llvm::IndexedInstrProfReader::create(ProfileName);
// In error, return silently and let Clang PGOUse report the error message.
if (auto E = ReaderOrErr.takeError()) {
auto FileToReplaces = groupReplacementsByFile(Replaces);
bool Result = true;
- for (auto &FileAndReplaces : FileToReplaces) {
- const std::string FilePath = FileAndReplaces.first;
+ for (const auto &FileAndReplaces : FileToReplaces) {
+ const std::string &FilePath = FileAndReplaces.first;
auto &CurReplaces = FileAndReplaces.second;
const FileEntry *Entry = Files.getFile(FilePath);