aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-02-23 12:32:08 -0800
committerFangrui Song <i@maskray.me>2021-02-23 16:09:05 -0800
commited02f52d288fb4d8f9049868afa6af84a980cbc3 (patch)
treebd166fee452c5619d49824581eefdb5a0420e3bd /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent3adb89bb9f8e73c82787babb2f877fece7394770 (diff)
downloadllvm-ed02f52d288fb4d8f9049868afa6af84a980cbc3.zip
llvm-ed02f52d288fb4d8f9049868afa6af84a980cbc3.tar.gz
llvm-ed02f52d288fb4d8f9049868afa6af84a980cbc3.tar.bz2
Fix unstable SmallPtrSet iteration issues due to collectUsedGlobalVariables
While here, decrease inline element counts from 8 to 4. See D97128 for the choice. Depends on D97128 (which added a new SmallVecImpl overload for collectUsedGlobalVariables). Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D97139
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index c555b67..dd47e220 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -4855,7 +4855,7 @@ void llvm::EmbedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,
const std::vector<uint8_t> &CmdArgs) {
// Save llvm.compiler.used and remove it.
SmallVector<Constant *, 2> UsedArray;
- SmallPtrSet<GlobalValue *, 4> UsedGlobals;
+ SmallVector<GlobalValue *, 4> UsedGlobals;
Type *UsedElementType = Type::getInt8Ty(M.getContext())->getPointerTo(0);
GlobalVariable *Used = collectUsedGlobalVariables(M, UsedGlobals, true);
for (auto *GV : UsedGlobals) {