public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Arthur Cohen <cohenarthur@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-7635] gccrs: converter: Add conversion from locations to spans
Date: Tue, 16 Jan 2024 17:49:18 +0000 (GMT)	[thread overview]
Message-ID: <20240116174918.CAF8E385841B@sourceware.org> (raw)

https://gcc.gnu.org/g:c37722cc9d57d04e7f74a72295c3fa0df628e2c9

commit r14-7635-gc37722cc9d57d04e7f74a72295c3fa0df628e2c9
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed May 31 11:17:56 2023 +0200

    gccrs: converter: Add conversion from locations to spans
    
    Add function implementation to convert either a Location or a
    RicheLocation to a libproc_macro span.
    
    gcc/rust/ChangeLog:
    
            * util/rust-token-converter.cc (convert): Add implementation.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 gcc/rust/util/rust-token-converter.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/util/rust-token-converter.cc b/gcc/rust/util/rust-token-converter.cc
index a50d7218113..6c18ae34e28 100644
--- a/gcc/rust/util/rust-token-converter.cc
+++ b/gcc/rust/util/rust-token-converter.cc
@@ -18,6 +18,7 @@
 #include "rust-token-converter.h"
 #include "libproc_macro/proc_macro.h"
 #include "bi-map.h"
+#include "line-map.h"
 
 #include <string>
 
@@ -53,7 +54,7 @@ pop_group (std::vector<ProcMacro::TokenStream> &streams,
 static ProcMacro::Span
 convert (Location location)
 {
-  return ProcMacro::Span::make_unknown ();
+  return ProcMacro::Span::make_span (location.gcc_location (), 0);
 }
 
 static void

                 reply	other threads:[~2024-01-16 17:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116174918.CAF8E385841B@sourceware.org \
    --to=cohenarthur@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).