Skip to content

llvm::MachO::InterfaceFile::symbols is non-deterministic #97127

Open
@MaskRay

Description

@MaskRay

std::unique_ptr<SymbolSet> SymbolsSet;
std::unique_ptr<SymbolSet> SymbolsSet; is implemented as a using SymbolsMapType = llvm::DenseMap<SymbolsMapKey, Symbol *>;, which has a non-deterministic iteration order in LLVM_ENABLE_ABI_BREAKING_CHECKS=on builds (hash_combine(hash_value(Key.Kind), hash_value(Key.Name)) uses a non-deterministic seed #96282).

This hade made lld/test/MachO/dead-strip.s flaky until I fixed by it with ceeea91.
The fix is imperfect, since it's better for llvm/include/llvm/TextAPI/InterfaceFile.h to provide a stable iteration order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions