mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-07-10 04:24:43 +03:00
rose: eliminate global final to fragment map
This commit is contained in:
parent
a06e877fde
commit
24ffb156e9
@ -4675,8 +4675,8 @@ void groupByFragment(RoseBuildImpl &build, const build_context &bc) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
map<rose_literal_id, FragmentInfo> frag_info;
|
map<rose_literal_id, FragmentInfo> frag_info;
|
||||||
|
map<u32, u32> final_to_frag;
|
||||||
|
|
||||||
auto &final_to_frag = build.final_to_frag_map;
|
|
||||||
auto &fragments = build.fragments;
|
auto &fragments = build.fragments;
|
||||||
|
|
||||||
for (const auto &m : bc.final_id_to_literal) {
|
for (const auto &m : bc.final_id_to_literal) {
|
||||||
@ -4747,8 +4747,11 @@ static
|
|||||||
void buildLiteralPrograms(RoseBuildImpl &build, build_context &bc) {
|
void buildLiteralPrograms(RoseBuildImpl &build, build_context &bc) {
|
||||||
// Build a reverse mapping from fragment -> final_id.
|
// Build a reverse mapping from fragment -> final_id.
|
||||||
map<u32, flat_set<u32>> frag_to_final_map;
|
map<u32, flat_set<u32>> frag_to_final_map;
|
||||||
for (const auto &m : build.final_to_frag_map) {
|
for (const auto &info : build.literal_info) {
|
||||||
frag_to_final_map[m.second].insert(m.first);
|
if (info.fragment_id == MO_INVALID_IDX) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
frag_to_final_map[info.fragment_id].insert(info.final_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_PRINTF("%zu fragments\n", build.fragments.size());
|
DEBUG_PRINTF("%zu fragments\n", build.fragments.size());
|
||||||
|
@ -590,7 +590,6 @@ public:
|
|||||||
* overlap calculation in history assignment. */
|
* overlap calculation in history assignment. */
|
||||||
std::map<u32, rose_literal_id> anchoredLitSuffix;
|
std::map<u32, rose_literal_id> anchoredLitSuffix;
|
||||||
|
|
||||||
std::map<u32, u32> final_to_frag_map;
|
|
||||||
std::vector<LitFragment> fragments;
|
std::vector<LitFragment> fragments;
|
||||||
|
|
||||||
unordered_set<left_id> transient;
|
unordered_set<left_id> transient;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user