[llgo] Update to use the latest IR attribute bindings
A recent commit (r286087) to the LLVM Go bindings that
changed things over to use the new attribute API broke
llgo. This commit updates llgo accordingly.
llvm-svn: 288769
diff --git a/llgo/irgen/maps.go b/llgo/irgen/maps.go
index b694bde..6e15396 100644
--- a/llgo/irgen/maps.go
+++ b/llgo/irgen/maps.go
@@ -39,8 +39,10 @@
pk := fr.allocaBuilder.CreateAlloca(llk.Type(), "")
fr.builder.CreateStore(llk, pk)
valptr := fr.runtime.mapIndex.call(fr, m.value, pk, boolLLVMValue(false))[0]
- valptr.AddInstrAttribute(2, llvm.NoCaptureAttribute)
- valptr.AddInstrAttribute(2, llvm.ReadOnlyAttribute)
+ attrkind := llvm.AttributeKindID("nocapture")
+ valptr.AddCallSiteAttribute(2, fr.types.ctx.CreateEnumAttribute(attrkind, 0))
+ attrkind = llvm.AttributeKindID("readonly")
+ valptr.AddCallSiteAttribute(2, fr.types.ctx.CreateEnumAttribute(attrkind, 0))
okbit := fr.builder.CreateIsNotNull(valptr, "")
elemtyp := m.Type().Underlying().(*types.Map).Elem()
@@ -55,8 +57,10 @@
pk := fr.allocaBuilder.CreateAlloca(llk.Type(), "")
fr.builder.CreateStore(llk, pk)
valptr := fr.runtime.mapIndex.call(fr, m.value, pk, boolLLVMValue(true))[0]
- valptr.AddInstrAttribute(2, llvm.NoCaptureAttribute)
- valptr.AddInstrAttribute(2, llvm.ReadOnlyAttribute)
+ attrkind := llvm.AttributeKindID("nocapture")
+ valptr.AddCallSiteAttribute(2, fr.types.ctx.CreateEnumAttribute(attrkind, 0))
+ attrkind = llvm.AttributeKindID("readonly")
+ valptr.AddCallSiteAttribute(2, fr.types.ctx.CreateEnumAttribute(attrkind, 0))
elemtyp := m.Type().Underlying().(*types.Map).Elem()
llelemtyp := fr.types.ToLLVM(elemtyp)