Clear the PendingTypeTests vector after moving from it.

This is to put the vector into a well defined state. Apparently the state of a
vector after being moved from is valid but unspecified. Found with clang-tidy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290298 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne
2016-12-22 02:52:23 +00:00
parent 48addbf5f8
commit 50b4952766

View File

@@ -4915,6 +4915,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(
auto FS = llvm::make_unique<FunctionSummary>(
Flags, InstCount, std::move(Refs), std::move(Calls),
std::move(PendingTypeTests));
PendingTypeTests.clear();
auto GUID = getGUIDFromValueId(ValueID);
FS->setModulePath(TheIndex.addModulePath(ModulePath, 0)->first());
FS->setOriginalName(GUID.second);
@@ -4989,6 +4990,7 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(
auto FS = llvm::make_unique<FunctionSummary>(
Flags, InstCount, std::move(Refs), std::move(Edges),
std::move(PendingTypeTests));
PendingTypeTests.clear();
LastSeenSummary = FS.get();
FS->setModulePath(ModuleIdMap[ModuleId]);
TheIndex.addGlobalValueSummary(GUID, std::move(FS));