[Support] Implement LLVM_ENABLE_REVERSE_ITERATION for StringMap
ProgrammersManual.html says > StringMap iteration order, however, is not guaranteed to be deterministic, so any uses which require that should instead use a std::map. This patch makes -DLLVM_REVERSE_ITERATION=on (currently -DLLVM_ENABLE_REVERSE_ITERATION=on works as well) shuffle StringMap iteration order (actually flipping the hash so that elements not in the same bucket are reversed) to catch violations, similar to D35043 for DenseMap. This should help change the hash function (e.g., D142862, D155781). With a lot of fixes, there are still some violations. This patch implements the "reverse_iteration" lit feature to skip such tests. Eventually we should remove this feature. `ninja check-{llvm,clang,clang-tools}` are clean with `#define LLVM_ENABLE_REVERSE_ITERATION 1`. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D155789
Loading
Please sign in to comment