1 // This file is part of GCC.
3 // GCC is free software; you can redistribute it and/or modify it under
4 // the terms of the GNU General Public License as published by the Free
5 // Software Foundation; either version 3, or (at your option) any later
8 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
9 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 // You should have received a copy of the GNU General Public License
14 // along with GCC; see the file COPYING3. If not see
15 // <http://www.gnu.org/licenses/>.
22 get_abi_from_string (const std::string
&abi
)
24 if (abi
.compare ("rust") == 0)
25 return Rust::ABI::RUST
;
26 else if (abi
.compare ("rust-call") == 0)
27 return Rust::ABI::RUST
;
28 else if (abi
.compare ("rust-intrinsic") == 0)
29 return Rust::ABI::INTRINSIC
;
30 else if (abi
.compare ("C") == 0)
32 else if (abi
.compare ("cdecl") == 0)
33 return Rust::ABI::CDECL
;
34 else if (abi
.compare ("stdcall") == 0)
35 return Rust::ABI::STDCALL
;
36 else if (abi
.compare ("fastcall") == 0)
37 return Rust::ABI::FASTCALL
;
38 else if (abi
.compare ("sysv64") == 0)
39 return Rust::ABI::SYSV64
;
40 else if (abi
.compare ("win64") == 0)
41 return Rust::ABI::WIN64
;
43 return Rust::ABI::UNKNOWN
;
47 get_string_from_abi (Rust::ABI abi
)
53 case Rust::ABI::INTRINSIC
:
54 return "rust-intrinsic";
57 case Rust::ABI::CDECL
:
59 case Rust::ABI::STDCALL
:
61 case Rust::ABI::FASTCALL
:
63 case Rust::ABI::SYSV64
:
65 case Rust::ABI::WIN64
:
68 case Rust::ABI::UNKNOWN
: