]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: collector: Move implementation to header
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 6 Jun 2023 12:57:14 +0000 (14:57 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:25 +0000 (18:46 +0100)
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>
gcc/rust/ast/rust-ast-collector.cc
gcc/rust/ast/rust-ast-collector.h

index a09869b7e6dde55d26110c648f50cdd60ceb1a77..639200aca79980469a6dd0b71f263e6f8c0e89cb 100644 (file)
@@ -43,13 +43,6 @@ TokenCollector::visit (AST::Item &item)
   item.accept_vis (*this);
 }
 
-template <typename T>
-void
-TokenCollector::visit (std::unique_ptr<T> &node)
-{
-  node->accept_vis (*this);
-}
-
 template <typename T>
 void
 TokenCollector::visit (T &node)
index e1857977a0355555526f55423c763593e00a96be..ae4f9fd9d130ccebc392ab0f929c3247db167c2b 100644 (file)
@@ -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>>