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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user