aboutsummaryrefslogtreecommitdiff
path: root/asm/preprocesser.cpp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-15 05:08:07 +0630
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-15 05:08:07 +0630
commit0e5c9340725a5ee0b419c8e61f221049ee3c542e (patch)
treeb3c32f1cf70f4b1887e99f617bd4b5fcf0986d5e /asm/preprocesser.cpp
parent9ca93786af90636bbace0631d87f1a565ba8f25e (diff)
downloadovm-0e5c9340725a5ee0b419c8e61f221049ee3c542e.tar.gz
ovm-0e5c9340725a5ee0b419c8e61f221049ee3c542e.tar.bz2
ovm-0e5c9340725a5ee0b419c8e61f221049ee3c542e.zip
preprocess_* now uses const references to tokens
They copy and construct new token vectors and just read the token inputs.
Diffstat (limited to 'asm/preprocesser.cpp')
-rw-r--r--asm/preprocesser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/asm/preprocesser.cpp b/asm/preprocesser.cpp
index dd7067a..aae1f0b 100644
--- a/asm/preprocesser.cpp
+++ b/asm/preprocesser.cpp
@@ -22,7 +22,7 @@ using std::pair, std::vector, std::make_pair, std::string, std::string_view;
#define VAL(E) std::make_pair(E, pp_err_t{pp_err_type_t::OK})
pair<vector<token_t *>, pp_err_t>
-preprocess_use_blocks(vector<token_t *> tokens)
+preprocess_use_blocks(const vector<token_t *> &tokens)
{
vector<token_t *> new_tokens;
for (size_t i = 0; i < tokens.size(); ++i)
@@ -69,7 +69,7 @@ struct const_t
};
pair<vector<token_t *>, pp_err_t>
-preprocess_const_blocks(vector<token_t *> &tokens)
+preprocess_const_blocks(vector<token_t *> const &tokens)
{
std::unordered_map<string_view, const_t> blocks;
for (size_t i = 0; i < tokens.size(); ++i)