]> git.ipfire.org Git - thirdparty/gcc.git/commit
Added FFIVector to get Polonius output on C++ side
authorKushal Pal <kushalpal109@gmail.com>
Wed, 5 Jun 2024 11:09:10 +0000 (11:09 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Tue, 16 Jul 2024 11:29:33 +0000 (11:29 +0000)
commit48c94c4927c818d0f9205b791d551743f3055e97
tree4180edb955d33742edca5c62e2423dfe55860c0e
parente2b6a02937c23fe28c895b935a8e12c206e7ec70
Added FFIVector to get Polonius output on C++ side

ChangeLog:

* .github/workflows/ccpp.yml: Switch to nightly version of rustc
to use unstable features, namely extern types for FFI.

gcc/rust/ChangeLog:

* Make-lang.in: Compile new file, rust-polonius.cc
* checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs: Opaque
type to represent FFIVector from C++.
* checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs:
Change types of fields in Output.
* checks/errors/borrowck/ffi-polonius/src/lib.rs: Added helper
functions to contruct Polonius output on C++ side,
used helpers to contruct Polonius output on C++ side.
* checks/errors/borrowck/polonius/rust-polonius-ffi.h (make_vector):
FFIVector is a wrapper around std::vector for transfering data
from Rust to C++.
(struct Output): Use pointers to FFIVector instead of bool to
store Polonius output data.
* checks/errors/borrowck/polonius/rust-polonius.h (FFIVector__new):
Helper function.
(FFIVector__new_vec_pair): Likewise.
(FFIVector__new_vec_triple): Likewise.
(FFIVector__push): Likewise.
(FFIVector__push_vec_pair): Likewise.
(FFIVector__push_vec_triple): Likewise.
* checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go):
Convert FFIVector to std::vector representation for easier
navigation.
* checks/errors/borrowck/polonius/rust-polonius.cc: New file,
implementation of helper functions.

Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
.github/workflows/ccpp.yml
gcc/rust/Make-lang.in
gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi.rs
gcc/rust/checks/errors/borrowck/ffi-polonius/src/gccrs_ffi_generated.rs
gcc/rust/checks/errors/borrowck/ffi-polonius/src/lib.rs
gcc/rust/checks/errors/borrowck/polonius/rust-polonius-ffi.h
gcc/rust/checks/errors/borrowck/polonius/rust-polonius.cc [new file with mode: 0644]
gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc