Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace #[inline(always)] by #[inline] due to the later being conside… #141

Merged
merged 1 commit into from
Sep 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ pub fn interrupt(
}

unsafe impl Nr for Interrupt {
#[inline(always)]
#[inline]
fn nr(&self) -> u8 {
match *self {
#(#arms)*
Expand Down Expand Up @@ -628,7 +628,7 @@ pub fn register(
if access == Access::ReadWrite {
reg_impl_items.push(quote! {
/// Modifies the contents of the register
#[inline(always)]
#[inline]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W
Expand All @@ -645,7 +645,7 @@ pub fn register(
if access == Access::ReadOnly || access == Access::ReadWrite {
reg_impl_items.push(quote! {
/// Reads the contents of the register
#[inline(always)]
#[inline]
pub fn read(&self) -> R {
R { bits: self.register.get() }
}
Expand All @@ -660,7 +660,7 @@ pub fn register(

r_impl_items.push(quote! {
/// Value of the register as raw bits
#[inline(always)]
#[inline]
pub fn bits(&self) -> #rty {
self.bits
}
Expand All @@ -670,7 +670,7 @@ pub fn register(
if access == Access::WriteOnly || access == Access::ReadWrite {
reg_impl_items.push(quote! {
/// Writes to the register
#[inline(always)]
#[inline]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W
Expand Down Expand Up @@ -699,13 +699,13 @@ pub fn register(

w_impl_items.push(quote! {
/// Reset value of the register
#[inline(always)]
#[inline]
pub fn reset_value() -> W {
W { bits: #rv }
}

/// Writes raw bits to the register
#[inline(always)]
#[inline]
pub #unsafety fn bits(&mut self, bits: #rty) -> &mut Self {
self.bits = bits;
self
Expand All @@ -716,7 +716,7 @@ pub fn register(
if access == Access::ReadWrite {
reg_impl_items.push(quote! {
/// Writes the reset value to the register
#[inline(always)]
#[inline]
pub fn reset(&self) {
self.write(|w| w)
}
Expand Down Expand Up @@ -969,7 +969,7 @@ pub fn fields(
let sc = &f.sc;
r_impl_items.push(quote! {
#[doc = #description]
#[inline(always)]
#[inline]
pub fn #sc(&self) -> #pc_r {
#pc_r::_from({ #value })
}
Expand Down Expand Up @@ -1029,13 +1029,13 @@ pub fn fields(
if f.width == 1 {
enum_items.push(quote! {
/// Returns `true` if the bit is clear (0)
#[inline(always)]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.#bits()
}

/// Returns `true` if the bit is set (1)
#[inline(always)]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.#bits()
}
Expand All @@ -1044,7 +1044,7 @@ pub fn fields(

enum_items.push(quote! {
/// Value of the field as raw bits
#[inline(always)]
#[inline]
pub fn #bits(&self) -> #fty {
match *self {
#(#arms),*
Expand Down Expand Up @@ -1077,7 +1077,7 @@ pub fn fields(
enum_items.push(quote! {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
#[inline]
pub fn _from(value: #fty) -> #pc_r {
match value {
#(#arms),*,
Expand All @@ -1101,7 +1101,7 @@ pub fn fields(
);
enum_items.push(quote! {
#[doc = #doc]
#[inline(always)]
#[inline]
pub fn #is_variant(&self) -> bool {
*self == #pc_r::#pc
}
Expand All @@ -1120,7 +1120,7 @@ pub fn fields(
let sc = &f.sc;
r_impl_items.push(quote! {
#[doc = #description]
#[inline(always)]
#[inline]
pub fn #sc(&self) -> #pc_r {
let bits = { #value };
#pc_r { bits }
Expand All @@ -1129,7 +1129,7 @@ pub fn fields(

let mut pc_r_impl_items = vec![quote! {
/// Value of the field as raw bits
#[inline(always)]
#[inline]
pub fn #bits(&self) -> #fty {
self.bits
}
Expand All @@ -1138,13 +1138,13 @@ pub fn fields(
if f.width == 1 {
pc_r_impl_items.push(quote! {
/// Returns `true` if the bit is clear (0)
#[inline(always)]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.#bits()
}

/// Returns `true` if the bit is set (1)
#[inline(always)]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.#bits()
}
Expand Down Expand Up @@ -1305,7 +1305,7 @@ pub fn fields(
impl #pc_w {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
#[inline]
pub fn _bits(&self) -> #fty {
match *self {
#(#arms),*
Expand All @@ -1318,7 +1318,7 @@ pub fn fields(

proxy_items.push(quote! {
/// Writes `variant` to the field
#[inline(always)]
#[inline]
pub fn variant(self, variant: #pc_w) -> &'a mut W {
#unsafety {
self.#bits(variant._bits())
Expand All @@ -1334,15 +1334,15 @@ pub fn fields(
if let Some(enum_) = base_pc_w.as_ref() {
proxy_items.push(quote! {
#[doc = #doc]
#[inline(always)]
#[inline]
pub fn #sc(self) -> &'a mut W {
self.variant(#enum_::#pc)
}
});
} else {
proxy_items.push(quote! {
#[doc = #doc]
#[inline(always)]
#[inline]
pub fn #sc(self) -> &'a mut W {
self.variant(#pc_w::#pc)
}
Expand All @@ -1367,7 +1367,7 @@ pub fn fields(

proxy_items.push(quote! {
/// Writes raw bits to the field
#[inline(always)]
#[inline]
pub #unsafety fn #bits(self, value: #fty) -> &'a mut W {
const MASK: #fty = #mask;
const OFFSET: u8 = #offset;
Expand All @@ -1394,7 +1394,7 @@ pub fn fields(
let sc = &f.sc;
w_impl_items.push(quote! {
#[doc = #description]
#[inline(always)]
#[inline]
pub fn #sc(&mut self) -> #_pc_w {
#_pc_w { w: self }
}
Expand Down