aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-06-06 14:57:14 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2023-06-08 14:32:34 +0200
commit69b2420743e34b6ec4d58cb7894eb3f480584ec4 (patch)
tree1721dfd19292fc6690250e5cf83e210f4c9ef01f
parentab44003c26a5dc5c92145d491e51b7582d51a4f6 (diff)
downloadgcc-69b2420743e34b6ec4d58cb7894eb3f480584ec4.zip
gcc-69b2420743e34b6ec4d58cb7894eb3f480584ec4.tar.gz
gcc-69b2420743e34b6ec4d58cb7894eb3f480584ec4.tar.bz2
collector: Move implementation to header
Move implementation from cc file to header, in order to allow call from other headers and prevent linker errors. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Move implementation from here... * ast/rust-ast-collector.h: ... to here. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/rust/ast/rust-ast-collector.cc7
-rw-r--r--gcc/rust/ast/rust-ast-collector.h5
2 files changed, 4 insertions, 8 deletions
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index a09869b..639200a 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -45,13 +45,6 @@ TokenCollector::visit (AST::Item &item)
template <typename T>
void
-TokenCollector::visit (std::unique_ptr<T> &node)
-{
- node->accept_vis (*this);
-}
-
-template <typename T>
-void
TokenCollector::visit (T &node)
{
node.accept_vis (*this);
diff --git a/gcc/rust/ast/rust-ast-collector.h b/gcc/rust/ast/rust-ast-collector.h
index e185797..ae4f9fd 100644
--- a/gcc/rust/ast/rust-ast-collector.h
+++ b/gcc/rust/ast/rust-ast-collector.h
@@ -47,7 +47,10 @@ private:
* types implementing `accept_vis` method and for classes for which the
* `visit` method is directly implemented.
*/
- template <typename T> void visit (std::unique_ptr<T> &node);
+ template <typename T> void visit (std::unique_ptr<T> &node)
+ {
+ node->accept_vis (*this);
+ }
/**
* @see visit<std::unique_ptr<T>>