https://gcc.gnu.org/g:5f0db57567e147846cd0b7aa4cb2fc8bba9208a0

commit 5f0db57567e147846cd0b7aa4cb2fc8bba9208a0
Author: Jakub Dupak <d...@jakubdupak.com>
Date:   Tue Feb 27 23:59:36 2024 +0100

    borrowck: Link Polonius and run it
    
    gcc/rust/ChangeLog:
    
            * Make-lang.in: Link Polonius.
            * checks/errors/borrowck/rust-borrow-checker.cc: Run Polonius.
    
    Signed-off-by: Jakub Dupak <d...@jakubdupak.com>

Diff:
---
 gcc/rust/Make-lang.in                                  | 7 +++++--
 gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 3275015b0466..dd94c9b5eab5 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -227,12 +227,15 @@ rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
 
 LIBPROC_MACRO_INTERNAL = 
../libgrust/libproc_macro_internal/libproc_macro_internal.a
 LIBFORMAT_PARSER = ../libgrust/libformat_parser/debug/liblibformat_parser.a
+LIBFFI_POLONIUS = rust/libffi_polonius.a
 
 # The compiler itself is called crab1
-crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) 
$(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(rust.prev)
+crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) 
$(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(LIBFFI_POLONIUS) $(rust.prev)
        @$(call LINK_PROGRESS,$(INDEX.rust),start)
        +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-             $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) 
$(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
+             $(RUST_ALL_OBJS) attribs.o $(BACKEND) \
+             $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) 
$(LIBFFI_POLONIUS) \
+                 $(BACKENDLIBS)
        @$(call LINK_PROGRESS,$(INDEX.rust),end)
 
 # Build hooks.
diff --git a/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc 
b/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
index a2351c57eb42..168b7054608d 100644
--- a/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
+++ b/gcc/rust/checks/errors/borrowck/rust-borrow-checker.cc
@@ -154,6 +154,8 @@ BorrowChecker::go (HIR::Crate &crate)
          dump_facts_to_file ("placeholder",
                              &Polonius::Facts::dump_placeholder);
        }
+
+      Polonius::polonius_run (facts.freeze (), rust_be_debug_p ());
     }
 
   for (auto closure ATTRIBUTE_UNUSED : collector.get_closures ())

Reply via email to