Open
Description
When looking at the implementation of Builder::load
, I noticed it is quite a bit more complex than volatile_load
.
load
creates a temporary rvalue to ensure the read remains in the correct block:
let deref = ptr.dereference(self.location).to_rvalue();
let loaded_value = function.new_local(
self.location,
aligned_type,
format!("loadedValue{}", self.next_value_counter()),
);
block.add_assignment(self.location, loaded_value, deref);
volatile_load
does no such thing:
fn volatile_load(&mut self, ty: Type<'gcc>, ptr: RValue<'gcc>) -> RValue<'gcc> {
let ptr = self.context.new_cast(self.location, ptr, ty.make_volatile().make_pointer());
ptr.dereference(self.location).to_rvalue()
}
Is this correct?
Metadata
Metadata
Assignees
Labels
No labels