Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit fa327ae

Browse files
committed
[PGO] Fix a use-after-move. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284664 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f4ca0f5 commit fa327ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/llvm-profdata/llvm-profdata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@ static void loadInput(const WeightedFile &Input, WriterContext *WC) {
158158
}
159159

160160
for (auto &I : *Reader) {
161+
const StringRef FuncName = I.Name;
161162
if (Error E = WC->Writer.addRecord(std::move(I), Input.Weight)) {
162163
// Only show hint the first time an error occurs.
163164
instrprof_error IPE = InstrProfError::take(std::move(E));
164165
std::unique_lock<std::mutex> ErrGuard{WC->ErrLock};
165166
bool firstTime = WC->WriterErrorCodes.insert(IPE).second;
166167
handleMergeWriterError(make_error<InstrProfError>(IPE), Input.Filename,
167-
I.Name, firstTime);
168+
FuncName, firstTime);
168169
}
169170
}
170171
if (Reader->hasError())

0 commit comments

Comments
 (0)