diff options
author | Kushal Pal <kushalpal109@gmail.com> | 2024-06-05 11:09:10 +0000 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-17 16:35:52 +0100 |
commit | 29f847e8b8cf21c12d07f2eec6a53f8bccdffeac (patch) | |
tree | ced5eb644ffe8d683c0d91c31ffd44cf8140aac9 /gcc/rust/Make-lang.in | |
parent | e50983a756329b2e27359a523d0ff1609c22aaa1 (diff) | |
download | gcc-29f847e8b8cf21c12d07f2eec6a53f8bccdffeac.zip gcc-29f847e8b8cf21c12d07f2eec6a53f8bccdffeac.tar.gz gcc-29f847e8b8cf21c12d07f2eec6a53f8bccdffeac.tar.bz2 |
gccrs: Added FFIVector to get Polonius output on C++ side
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>
Diffstat (limited to 'gcc/rust/Make-lang.in')
-rw-r--r-- | gcc/rust/Make-lang.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index 4f164c9..17f1feb 100644 --- a/gcc/rust/Make-lang.in +++ b/gcc/rust/Make-lang.in @@ -171,6 +171,7 @@ GRS_OBJS = \ rust/rust-borrow-checker.o \ rust/rust-bir-builder-expr-stmt.o \ rust/rust-bir-dump.o \ + rust/rust-polonius.o\ rust/rust-hir-dot-operator.o \ rust/rust-hir-path-probe.o \ rust/rust-type-util.o \ @@ -487,6 +488,12 @@ rust/%.o: rust/checks/errors/borrowck/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< $(POSTCOMPILE) + +# build borrow checking pass polonius files in rust folder +rust/%.o: rust/checks/errors/borrowck/polonius/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + # build rust/metadata files in rust folder rust/%.o: rust/metadata/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< |