StoreUnaligned stores val to the pointer ptr. It assumes that the destination address may be unaligned
(val *Value)
| 82 | // StoreUnaligned stores val to the pointer ptr. It assumes that the |
| 83 | // destination address may be unaligned |
| 84 | func (v *Value) StoreUnaligned(val *Value) { |
| 85 | if !IsPointer(v.ty) { |
| 86 | fail("Store must be to a pointer. Got %v", v.Type) |
| 87 | } |
| 88 | elTy := v.Type().(Pointer).Element |
| 89 | if val.ty.String() != elTy.String() { |
| 90 | fail("Attempted to store value of type %v to pointer element type %v", |
| 91 | val.ty.TypeName(), elTy.TypeName()) |
| 92 | } |
| 93 | store := v.b.llvm.CreateStore(val.llvm, v.llvm) |
| 94 | store.SetAlignment(1) |
| 95 | } |
| 96 | |
| 97 | // Store stores val to the pointer ptr. |
| 98 | func (v *Value) Store(val *Value) { |