mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-28 19:29:28 +00:00
Stop naming instructions with numbered names.
LLVM will number instructions if you don't provide a name, so we get %7 instead of %s7 from calling state.var_name(). LLVM doesn't assign the numbers until printing out the LLVM IR as text, which we never do in a normal run of wasmer. If you're editing a .ll text by hand and you're worried about messing up the numbering, use `opt --instnamer` to assign autogenerated names to all numbered instructions.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,6 @@ use inkwell::{
|
||||
values::{BasicValue, BasicValueEnum, PhiValue},
|
||||
};
|
||||
use smallvec::SmallVec;
|
||||
use std::cell::Cell;
|
||||
use std::ops::{BitAnd, BitOr, BitOrAssign};
|
||||
use wasmer_compiler::CompileError;
|
||||
|
||||
@ -196,7 +195,6 @@ impl BitAnd for ExtraInfo {
|
||||
pub struct State<'ctx> {
|
||||
pub stack: Vec<(BasicValueEnum<'ctx>, ExtraInfo)>,
|
||||
control_stack: Vec<ControlFrame<'ctx>>,
|
||||
value_counter: Cell<usize>,
|
||||
|
||||
pub reachable: bool,
|
||||
}
|
||||
@ -206,7 +204,6 @@ impl<'ctx> State<'ctx> {
|
||||
Self {
|
||||
stack: vec![],
|
||||
control_stack: vec![],
|
||||
value_counter: Cell::new(0),
|
||||
reachable: true,
|
||||
}
|
||||
}
|
||||
@ -270,13 +267,6 @@ impl<'ctx> State<'ctx> {
|
||||
))
|
||||
}
|
||||
|
||||
pub fn var_name(&self) -> String {
|
||||
let counter = self.value_counter.get();
|
||||
let s = format!("s{}", counter);
|
||||
self.value_counter.set(counter + 1);
|
||||
s
|
||||
}
|
||||
|
||||
pub fn push1<T: BasicValue<'ctx>>(&mut self, value: T) {
|
||||
self.push1_extra(value, Default::default());
|
||||
}
|
||||
|
Reference in New Issue
Block a user