Skip to content

Commit

Permalink
Using map instead of unordered_map to ensure reproducibility of k…
Browse files Browse the repository at this point in the history
…ore 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.
  • Loading branch information
Robertorosmaninho authored May 16, 2024
1 parent 5b5affe commit 2e36aee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/kllvm/ast/attribute_set.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef KLLVM_ATTRIBUTES_H
#define KLLVM_ATTRIBUTES_H

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>

namespace kllvm {

Expand All @@ -29,8 +29,8 @@ class kore_composite_pattern;
*/
class attribute_set {
public:
using storage_t = std::unordered_map<
std::string, std::shared_ptr<kore_composite_pattern>>;
using storage_t
= std::map<std::string, std::shared_ptr<kore_composite_pattern>>;

enum class key {
Alias,
Expand Down

0 comments on commit 2e36aee

Please sign in to comment.