Debian Codegraph @

gcc/rust/checks/errors/borrowck/polonius/rust-polonius.cc

raw
1 // Copyright (C) 2020-2024 Free Software Foundation, Inc.
2
3 // This file is part of GCC.
4
5 // GCC is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation; either version 3, or (at your option) any later
8 // version.
9
10 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 // for more details.
14
15 // You should have received a copy of the GNU General Public License
16 // along with GCC; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
18
19 #include "rust-polonius.h"
20
21 namespace Rust {
22 namespace Polonius {
23
24 extern "C" {
25
26 FFI::FFIVector<size_t> *
27 FFIVector__new ()
28 {
29 return FFI::FFIVector<size_t>::make_new ();
30 }
31
32 FFI::FFIVectorPair *
33 FFIVector__new_vec_pair ()
34 {
35 return FFI::FFIVectorPair::make_new ();
36 }
37
38 FFI::FFIVectorTriple *
39 FFIVector__new_vec_triple ()
40 {
41 return FFI::FFIVectorTriple::make_new ();
42 }
43
44 void
45 FFIVector__push (FFI::FFIVector<size_t> *vector, size_t element)
46 {
47 vector->push (element);
48 }
49
50 void
51 FFIVector__push_vec_pair (FFI::FFIVectorPair *vector,
52 FFI::Pair<size_t, FFI::FFIVector<size_t> *> element)
53 {
54 vector->push (element);
55 }
56
57 void
58 FFIVector__push_vec_triple (FFI::FFIVectorTriple *vector,
59 FFI::Triple<size_t, size_t, size_t> element)
60 {
61 vector->push (element);
62 }
63 }
64
65 } // namespace Polonius
66 } // namespace Rust