]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: converter: Add conversion from locations to spans
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 31 May 2023 09:17:56 +0000 (11:17 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:23 +0000 (18:46 +0100)
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>
gcc/rust/util/rust-token-converter.cc

index a50d7218113342bd3019988f77f3231b828850d2..6c18ae34e28361569632f7475ff8de883c4579bd 100644 (file)
@@ -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