Skip to content

Commit

Permalink
rustc_trans: support scalar pairs directly in the Rust ABI.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Nov 19, 2017
1 parent 7a36141 commit 18ecc56
Show file tree
Hide file tree
Showing 9 changed files with 367 additions and 363 deletions.
9 changes: 3 additions & 6 deletions src/librustc_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,19 @@ pub fn AddFunctionAttrStringValue(llfn: ValueRef,
}
}

#[repr(C)]
#[derive(Copy, Clone)]
pub enum AttributePlace {
ReturnValue,
Argument(u32),
Function,
}

impl AttributePlace {
pub fn ReturnValue() -> Self {
AttributePlace::Argument(0)
}

pub fn as_uint(self) -> c_uint {
match self {
AttributePlace::ReturnValue => 0,
AttributePlace::Argument(i) => 1 + i,
AttributePlace::Function => !0,
AttributePlace::Argument(i) => i,
}
}
}
Expand Down
Loading

0 comments on commit 18ecc56

Please sign in to comment.