aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorReinUsesLisp <[email protected]>2019-06-08 05:23:15 -0300
committerReinUsesLisp <[email protected]>2019-06-08 05:23:15 -0300
commit1e665afa361d0c91b2b3a226a1c537d0b504ca11 (patch)
tree82664ab31a00b69b23119993a2dd83da4eb39b72 /include
parentf7c4b07a7e14edb1dcd93bc9879c823423705c2e (diff)
downloadsirit-1e665afa361d0c91b2b3a226a1c537d0b504ca11.tar.gz
sirit-1e665afa361d0c91b2b3a226a1c537d0b504ca11.zip
operand: Implement operand hashing and use hashed set for declarations
Instead of manually searching each element in the declarations vector, use an unordered_set to emplace new declarations avoiding repetition.
Diffstat (limited to 'include')
-rw-r--r--include/sirit/sirit.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h
index eee5cff..35b8fd8 100644
--- a/include/sirit/sirit.h
+++ b/include/sirit/sirit.h
@@ -933,7 +933,8 @@ private:
std::vector<std::unique_ptr<Op>> execution_modes;
std::vector<std::unique_ptr<Op>> debug;
std::vector<std::unique_ptr<Op>> annotations;
- std::vector<std::unique_ptr<Op>> declarations;
+ std::unordered_set<std::unique_ptr<Op>> declarations;
+ std::vector<Id> sorted_declarations;
std::vector<Id> global_variables;