Initial refactor of id_t to a separate class

This commit is contained in:
Bartek Kryza
2024-06-04 00:03:26 +02:00
parent e21c2d2b14
commit cf79b3184c
37 changed files with 374 additions and 248 deletions

View File

@@ -116,14 +116,14 @@ struct call_expression_context {
*
* @param id Set current caller id.
*/
void set_caller_id(std::int64_t id);
void set_caller_id(common::id_t id);
/**
* @brief Get current caller id
*
* @return Id of the current caller participant
*/
std::int64_t caller_id() const;
common::id_t caller_id() const;
/**
* @brief Get the id of the current lambda caller.
@@ -133,14 +133,14 @@ struct call_expression_context {
*
* @return Current lambda caller id, or 0 if current caller is not lambda.
*/
std::int64_t lambda_caller_id() const;
std::optional<common::id_t> lambda_caller_id() const;
/**
* @brief Enter a lambda expression
*
* @param id Lambda id
*/
void enter_lambda_expression(std::int64_t id);
void enter_lambda_expression(common::id_t id);
/**
* @brief Leave current lambda expression
@@ -315,8 +315,8 @@ struct call_expression_context {
clang::FunctionTemplateDecl *current_function_template_decl_{nullptr};
private:
std::int64_t current_caller_id_{0};
std::stack<std::int64_t> current_lambda_caller_id_;
common::id_t current_caller_id_{};
std::stack<common::id_t> current_lambda_caller_id_;
std::stack<callexpr_stack_t> call_expr_stack_;