This file implements volatile loads/stores in runtime/volatile.LoadT and runtime/volatile.StoreT as compiler builtins. createVolatileLoad is the implementation of the intrinsic function runtime/volatile.LoadT().
()
| 8 | // createVolatileLoad is the implementation of the intrinsic function |
| 9 | // runtime/volatile.LoadT(). |
| 10 | func (b *builder) createVolatileLoad() { |
| 11 | b.createFunctionStart(true) |
| 12 | addr := b.getValue(b.fn.Params[0], getPos(b.fn)) |
| 13 | b.createNilCheck(b.fn.Params[0], addr, "deref") |
| 14 | valType := b.getLLVMType(b.fn.Params[0].Type().(*types.Pointer).Elem()) |
| 15 | val := b.CreateLoad(valType, addr, "") |
| 16 | val.SetVolatile(true) |
| 17 | b.CreateRet(val) |
| 18 | } |
| 19 | |
| 20 | // createVolatileStore is the implementation of the intrinsic function |
| 21 | // runtime/volatile.StoreT(). |
no test coverage detected