aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/TimeProfiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/TimeProfiler.cpp')
-rw-r--r--llvm/lib/Support/TimeProfiler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index 24da35c..4e48477 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -166,7 +166,7 @@ struct TimeTraceProfiler {
// Combine all CountAndTotalPerName from threads into one.
StringMap<CountAndDurationType> AllCountAndTotalPerName;
auto combineStat = [&](const auto &Stat) {
- std::string Key = Stat.getKey();
+ StringRef Key = Stat.getKey();
auto Value = Stat.getValue();
auto &CountAndTotal = AllCountAndTotalPerName[Key];
CountAndTotal.first += Value.first;
@@ -275,13 +275,14 @@ void timeTraceProfilerWrite(raw_pwrite_stream &OS) {
void timeTraceProfilerBegin(StringRef Name, StringRef Detail) {
if (TimeTraceProfilerInstance != nullptr)
- TimeTraceProfilerInstance->begin(Name, [&]() { return Detail; });
+ TimeTraceProfilerInstance->begin(std::string(Name),
+ [&]() { return std::string(Detail); });
}
void timeTraceProfilerBegin(StringRef Name,
llvm::function_ref<std::string()> Detail) {
if (TimeTraceProfilerInstance != nullptr)
- TimeTraceProfilerInstance->begin(Name, Detail);
+ TimeTraceProfilerInstance->begin(std::string(Name), Detail);
}
void timeTraceProfilerEnd() {