MCPcopy Index your code
hub / github.com/tinygo-org/tinygo / createVolatileLoad

Method createVolatileLoad

compiler/volatile.go:10–18  ·  view source on GitHub ↗

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().

()

Source from the content-addressed store, hash-verified

8// createVolatileLoad is the implementation of the intrinsic function
9// runtime/volatile.LoadT().
10func (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().

Callers 1

Calls 7

createFunctionStartMethod · 0.95
getValueMethod · 0.95
createNilCheckMethod · 0.95
getLLVMTypeMethod · 0.80
getPosFunction · 0.70
ElemMethod · 0.65
TypeMethod · 0.45

Tested by

no test coverage detected