mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
gccrs: proc_macro: Mirror FFIString changes in C++library
Recent changes in the rust interface on some extern C function shall be synced up in the C++ library. libgrust/ChangeLog: * libproc_macro/literal.cc (Literal__from_string): Update to match rust interface. * libproc_macro/literal.h (Literal__from_string): Likewise. * libproc_macro/tokenstream.cc (TokenStream__from_string): Likewise. * libproc_macro/tokenstream.h (TokenStream__from_string): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
parent
f00f3837ef
commit
973f4088ef
@ -28,7 +28,7 @@ namespace ProcMacro {
|
||||
|
||||
extern "C" {
|
||||
bool
|
||||
Literal__from_string (const unsigned char *str, std::uint64_t len, Literal *lit)
|
||||
Literal__from_string (FFIString str, Literal *lit)
|
||||
{
|
||||
// FIXME: implement this function with lexer
|
||||
std::abort ();
|
||||
|
@ -105,8 +105,7 @@ public:
|
||||
|
||||
extern "C" {
|
||||
bool
|
||||
Literal__from_string (const unsigned char *str, std::uint64_t len,
|
||||
Literal *lit);
|
||||
Literal__from_string (FFIString str, Literal *lit);
|
||||
}
|
||||
} // namespace ProcMacro
|
||||
|
||||
|
@ -103,11 +103,10 @@ TokenSream__push (TokenStream *stream, TokenTree tree)
|
||||
}
|
||||
|
||||
extern "C" bool
|
||||
TokenStream__from_string (unsigned char *str, std::uint64_t len,
|
||||
TokenStream *ts)
|
||||
TokenStream__from_string (FFIString str, TokenStream *ts)
|
||||
{
|
||||
bool result;
|
||||
auto source = std::string (reinterpret_cast<const char *> (str), len);
|
||||
auto source = str.to_string ();
|
||||
|
||||
*ts = TokenStream::make_tokenstream (source, result);
|
||||
return result;
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "ffistring.h"
|
||||
|
||||
namespace ProcMacro {
|
||||
struct TokenTree;
|
||||
|
||||
@ -59,8 +61,7 @@ extern "C" void
|
||||
TokenSream__push (TokenStream *stream, TokenTree tree);
|
||||
|
||||
extern "C" bool
|
||||
TokenStream__from_string (unsigned char *str, std::uint64_t len,
|
||||
TokenStream *ts);
|
||||
TokenStream__from_string (FFIString str, TokenStream *ts);
|
||||
|
||||
extern "C" TokenStream
|
||||
TokenStream__clone (const TokenStream *ts);
|
||||
|
Loading…
Reference in New Issue
Block a user