Skip to content

Commit

Permalink
chore: remove inline attributes in IR builtins (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jul 16, 2024
1 parent fd02a34 commit 9d265bc
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions crates/revmc/src/compiler/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1543,12 +1543,6 @@ impl<'a, B: Backend> FunctionCx<'a, B> {

/// Builds: `fn calldataload(index: u256, contract: ptr) -> u256`
fn build_calldataload(&mut self) {
self.bcx.add_function_attribute(
None,
Attribute::NoInline,
FunctionAttributeLocation::Function,
);

let index = self.bcx.fn_param(0);
let contract = self.bcx.fn_param(1);

Expand Down Expand Up @@ -1645,13 +1639,6 @@ impl<'a, B: Backend> FunctionCx<'a, B> {

fn build_mem_op(&mut self, kind: MemOpKind) {
let is_load = matches!(kind, MemOpKind::Load);
// if is_load {
self.bcx.add_function_attribute(
None,
Attribute::NoInline,
FunctionAttributeLocation::Function,
);
// }
let ptr_args = if is_load { &[1, 2][..] } else { &[2][..] };
for &ptr_arg in ptr_args {
for attr in default_attrs::for_ref() {
Expand Down Expand Up @@ -1772,15 +1759,7 @@ impl<'a, B: Backend> FunctionCx<'a, B> {
build: fn(&mut Self),
) -> B::Value {
let word = self.word_type;
self.call_ir_builtin(name, &[x1, x2], &[word, word], Some(word), |this| {
build(this);
this.bcx.add_function_attribute(
None,
Attribute::NoInline,
FunctionAttributeLocation::Function,
);
})
.unwrap()
self.call_ir_builtin(name, &[x1, x2], &[word, word], Some(word), build).unwrap()
}

#[must_use]
Expand Down Expand Up @@ -1836,7 +1815,6 @@ mod pf {
pub(super) struct Bytes {
pub(super) ptr: *const u8,
pub(super) len: usize,
// inlined "trait object"
data: AtomicPtr<()>,
vtable: &'static Vtable,
}
Expand Down

0 comments on commit 9d265bc

Please sign in to comment.