Skip to content

Commit 2e36aee

Browse files
Using map instead of unordered_map to ensure reproducibility of kore definition generation (#1059)
We have seen that the `definition.kore` has been produced in a different order depending on the OS, which creates a flaky error for some tools like `llvm-komplie-compute-ordinal` and `llvm-kompile-compute-loc`, an error on #1053 MacOS tests, and some frontend errors as well. This PR aims to fix that issue by replacing the data structure used to store the attributes.
1 parent 5b5affe commit 2e36aee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/kllvm/ast/attribute_set.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef KLLVM_ATTRIBUTES_H
22
#define KLLVM_ATTRIBUTES_H
33

4+
#include <map>
45
#include <memory>
56
#include <optional>
67
#include <string>
7-
#include <unordered_map>
88

99
namespace kllvm {
1010

@@ -29,8 +29,8 @@ class kore_composite_pattern;
2929
*/
3030
class attribute_set {
3131
public:
32-
using storage_t = std::unordered_map<
33-
std::string, std::shared_ptr<kore_composite_pattern>>;
32+
using storage_t
33+
= std::map<std::string, std::shared_ptr<kore_composite_pattern>>;
3434

3535
enum class key {
3636
Alias,

0 commit comments

Comments
 (0)