diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -55,7 +55,7 @@ for (auto &CounterName : CounterNames) { CounterName = CounterName.trim(); auto CounterOrError = - State.getExegesisTarget().createCounter(CounterName.data(), State); + State.getExegesisTarget().createCounter(CounterName, State); if (!CounterOrError) return CounterOrError.takeError(); diff --git a/llvm/tools/llvm-exegesis/lib/Target.h b/llvm/tools/llvm-exegesis/lib/Target.h --- a/llvm/tools/llvm-exegesis/lib/Target.h +++ b/llvm/tools/llvm-exegesis/lib/Target.h @@ -69,7 +69,7 @@ // Targets can use this to create target-specific perf counters. virtual Expected> - createCounter(const char *CounterName, const LLVMState &State) const; + createCounter(StringRef CounterName, const LLVMState &State) const; // Targets can use this to add target-specific passes in assembleToStream(); virtual void addTargetSpecificPasses(PassManagerBase &PM) const {} diff --git a/llvm/tools/llvm-exegesis/lib/Target.cpp b/llvm/tools/llvm-exegesis/lib/Target.cpp --- a/llvm/tools/llvm-exegesis/lib/Target.cpp +++ b/llvm/tools/llvm-exegesis/lib/Target.cpp @@ -30,8 +30,7 @@ } Expected> -ExegesisTarget::createCounter(const char *CounterName, - const LLVMState &) const { +ExegesisTarget::createCounter(StringRef CounterName, const LLVMState &) const { pfm::PerfEvent Event(CounterName); if (!Event.valid()) return llvm::make_error(