summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-06-04 22:11:28 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-06-04 22:11:28 +0000
commit08b4728f5194cd03b1100b00d4d08ac2d468a400 (patch)
tree14f6035adc55b8db77f3ec90e926e15fd9c8f328
parent46dd55f1e1fdbc8cdf1d2ca535864e255ab84cc2 (diff)
downloadbcm5719-llvm-08b4728f5194cd03b1100b00d4d08ac2d468a400.tar.gz
bcm5719-llvm-08b4728f5194cd03b1100b00d4d08ac2d468a400.zip
irgen: Create functions instead of global variables for builtin hash and equal algorithms.
These are in fact functions, and have function type, so it is invalid to represent them using global variables. llvm-svn: 304689
-rw-r--r--llgo/irgen/typemap.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/llgo/irgen/typemap.go b/llgo/irgen/typemap.go
index 2ae1a4e2b93..7da752e07e4 100644
--- a/llgo/irgen/typemap.go
+++ b/llgo/irgen/typemap.go
@@ -151,9 +151,9 @@ func NewTypeMap(pkg *ssa.Package, llvmtm *llvmTypeMap, module llvm.Module, r *ru
hashDescriptorName := hashFnName + "_descriptor"
equalFnName := "__go_type_equal_" + typeAlgs.Name
equalDescriptorName := equalFnName + "_descriptor"
- typeAlgs.hash = llvm.AddGlobal(tm.module, tm.hashFnType, hashFnName)
+ typeAlgs.hash = llvm.AddFunction(tm.module, hashFnName, tm.hashFnType)
typeAlgs.hashDescriptor = llvm.AddGlobal(tm.module, tm.funcValType, hashDescriptorName)
- typeAlgs.equal = llvm.AddGlobal(tm.module, tm.equalFnType, equalFnName)
+ typeAlgs.equal = llvm.AddFunction(tm.module, equalFnName, tm.equalFnType)
typeAlgs.equalDescriptor = llvm.AddGlobal(tm.module, tm.funcValType, equalDescriptorName)
}
OpenPOWER on IntegriCloud