diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-22 02:52:23 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-22 02:52:23 +0000 |
commit | 704f814a5e5f9bb65749a56ddb66eb9be22c0736 (patch) | |
tree | 3cd2a3e9b4c5f04a68abafb302cd9e29e257648c /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | e37633713d93b21533d8699d0b5cf4703e3f4039 (diff) | |
download | llvm-704f814a5e5f9bb65749a56ddb66eb9be22c0736.zip llvm-704f814a5e5f9bb65749a56ddb66eb9be22c0736.tar.gz llvm-704f814a5e5f9bb65749a56ddb66eb9be22c0736.tar.bz2 |
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.
llvm-svn: 290298
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 55f2af6..03aefcf 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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)); |