compiler; add position information to createConstant

Non-functional change. The position information will be used later to
emit debug info locations to string constants.
This commit is contained in:
Ayke van Laethem
2023-03-05 17:34:36 +01:00
committed by Ayke
parent 930255ff46
commit 0ce539ad42
13 changed files with 109 additions and 108 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ import "go/types"
// runtime/volatile.LoadT().
func (b *builder) createVolatileLoad() {
b.createFunctionStart(true)
addr := b.getValue(b.fn.Params[0])
addr := b.getValue(b.fn.Params[0], getPos(b.fn))
b.createNilCheck(b.fn.Params[0], addr, "deref")
valType := b.getLLVMType(b.fn.Params[0].Type().(*types.Pointer).Elem())
val := b.CreateLoad(valType, addr, "")
@@ -21,8 +21,8 @@ func (b *builder) createVolatileLoad() {
// runtime/volatile.StoreT().
func (b *builder) createVolatileStore() {
b.createFunctionStart(true)
addr := b.getValue(b.fn.Params[0])
val := b.getValue(b.fn.Params[1])
addr := b.getValue(b.fn.Params[0], getPos(b.fn))
val := b.getValue(b.fn.Params[1], getPos(b.fn))
b.createNilCheck(b.fn.Params[0], addr, "deref")
store := b.CreateStore(val, addr)
store.SetVolatile(true)