Skip to content

Commit

Permalink
perf: Rework system variables
Browse files Browse the repository at this point in the history
  • Loading branch information
slavek-kucera authored Dec 18, 2023
1 parent 9b9c78b commit 9e6f036
Show file tree
Hide file tree
Showing 24 changed files with 348 additions and 295 deletions.
16 changes: 10 additions & 6 deletions parser_library/src/context/code_scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,20 @@
#define CONTEXT_CODE_SCOPE_H

#include "macro.h"
#include "variables/set_symbol.h"
#include "variables/system_variable.h"
#include "utils/time.h"

namespace hlasm_plugin::parser_library::context {
class location_counter;
class set_symbol_base;

// helper struct for HLASM code scopes
// contains locally valid set symbols, sequence symbols and pointer to macro class (if code is in any)
struct code_scope
{
using set_sym_storage = std::unordered_map<id_index, std::shared_ptr<set_symbol_base>>;
using sys_sym_storage = std::unordered_map<id_index, std::shared_ptr<system_variable>>;
using set_sym_storage = std::unordered_map<id_index, std::pair<std::shared_ptr<set_symbol_base>, bool>>;

// local variables of scope
set_sym_storage variables;
// local system variables of scope
sys_sym_storage system_variables;
// gets macro to which this scope belong (nullptr if in open code)
std::unique_ptr<macro_invocation> this_macro;
// the ACTR branch counter
Expand All @@ -40,6 +38,12 @@ struct code_scope
size_t branch_counter_change = 0;
// variable for implementing &SYSM_SEV
unsigned mnote_max_in_scope = 0;
// scope creation time
utils::timestamp time;
// initial location counter
location_counter* loctr = nullptr;
// scope unique value
unsigned long sysndx = 0;

bool is_in_macro() const { return !!this_macro; }

Expand Down
Loading

0 comments on commit 9e6f036

Please sign in to comment.