syntax: Remove AbiSet, use one Abi

This change removes the AbiSet from the AST, converting all usage to have just
one Abi value. The current scheme selects a relevant ABI given a list of ABIs
based on the target architecture and how relevant each ABI is to that
architecture.

Instead of this mildly complicated scheme, only one ABI will be allowed in abi
strings, and pseudo-abis will be created for special cases as necessary. For
example the "system" abi exists for stdcall on win32 and C on win64.

Closes #10049
This commit is contained in:
Alex Crichton
2014-04-02 01:19:41 -07:00
parent 1a1c47b918
commit 57e0908af3
33 changed files with 205 additions and 460 deletions

View File

@@ -11,7 +11,7 @@
// The Rust abstract syntax tree.
use codemap::{Span, Spanned, DUMMY_SP};
use abi::AbiSet;
use abi::Abi;
use ast_util;
use owned_slice::OwnedSlice;
use parse::token::{InternedString, special_idents, str_to_ident};
@@ -807,7 +807,7 @@ pub struct ClosureTy {
#[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
pub struct BareFnTy {
pub purity: Purity,
pub abis: AbiSet,
pub abi: Abi,
pub lifetimes: Vec<Lifetime>,
pub decl: P<FnDecl>
}
@@ -941,7 +941,7 @@ pub struct Mod {
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
pub struct ForeignMod {
pub abis: AbiSet,
pub abi: Abi,
pub view_items: Vec<ViewItem>,
pub items: Vec<@ForeignItem>,
}
@@ -1119,7 +1119,7 @@ pub struct Item {
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
pub enum Item_ {
ItemStatic(P<Ty>, Mutability, @Expr),
ItemFn(P<FnDecl>, Purity, AbiSet, Generics, P<Block>),
ItemFn(P<FnDecl>, Purity, Abi, Generics, P<Block>),
ItemMod(Mod),
ItemForeignMod(ForeignMod),
ItemTy(P<Ty>, Generics),