Skip to content

Commit

Permalink
Make the symbol parameter of the NodeHandle constructor const
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd committed Jan 8, 2024
1 parent a7fc844 commit 0515599
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ccc/symbol_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ bool SymbolDatabase::destroy_function(FunctionHandle handle)
NodeHandle::NodeHandle() {}

template <typename SymbolType>
NodeHandle::NodeHandle(SymbolType& symbol, const ast::Node* node)
NodeHandle::NodeHandle(const SymbolType& symbol, const ast::Node* node)
: m_descriptor(SymbolType::DESCRIPTOR)
, m_symbol_handle(symbol.handle().value)
, m_node(node)
Expand Down Expand Up @@ -728,7 +728,7 @@ NodeHandle NodeHandle::handle_for_child(const ast::Node* child_node) const
return child_handle;
}

#define CCC_X(SymbolType, symbol_list) template NodeHandle::NodeHandle(SymbolType& symbol, const ast::Node* node);
#define CCC_X(SymbolType, symbol_list) template NodeHandle::NodeHandle(const SymbolType& symbol, const ast::Node* node);
CCC_FOR_EACH_SYMBOL_TYPE_DO_X
#undef CCC_X

Expand Down
2 changes: 1 addition & 1 deletion src/ccc/symbol_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ class NodeHandle {
public:
NodeHandle();
template <typename SymbolType>
NodeHandle(SymbolType& symbol, const ast::Node* node);
NodeHandle(const SymbolType& symbol, const ast::Node* node);

friend auto operator<=>(const NodeHandle& lhs, const NodeHandle& rhs) = default;

Expand Down

0 comments on commit 0515599

Please sign in to comment.