Add llvm 'readonly' attribute to calls of the memory size function.

In passing, delete a lot of dead code. Remove old VM intrinsics for memory.size, memory.grow and breakpoints.
This commit is contained in:
Nick Lewycky
2020-05-22 16:55:57 -07:00
parent 17908b6b45
commit 630be7733d
2 changed files with 5 additions and 112 deletions

View File

@ -7,6 +7,7 @@ use super::{
state::{ControlFrame, ExtraInfo, IfElseState, State},
};
use inkwell::{
attributes::AttributeLoc,
builder::Builder,
context::Context,
module::{Linkage, Module},
@ -8245,6 +8246,7 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
],
"",
);
size.add_attribute(AttributeLoc::Function, self.intrinsics.readonly);
self.state.push1(size.try_as_basic_value().left().unwrap());
}
_ => {