diff options
author | Fangrui Song <i@maskray.me> | 2021-02-23 12:32:08 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-02-23 16:09:05 -0800 |
commit | ed02f52d288fb4d8f9049868afa6af84a980cbc3 (patch) | |
tree | bd166fee452c5619d49824581eefdb5a0420e3bd /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 3adb89bb9f8e73c82787babb2f877fece7394770 (diff) | |
download | llvm-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.cpp | 2 |
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) { |