[gcc r14-7635] gccrs: converter: Add conversion from locations to spans
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 16 17:49:18 GMT 2024
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
More information about the Gcc-cvs
mailing list