[PATCH] D58030: [bindings/go] Fix building on 32-bit systems (ARM etc.)

whitequark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 03:16:50 PST 2019


whitequark accepted this revision.
whitequark added a comment.
This revision is now accepted and ready to land.

Seems fine, with or without the length change. Hopefully this can get into 8.0.



================
Comment at: bindings/go/llvm/ir.go:1265
 	// https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
-	rawIndices := (*[1 << 30]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
+	rawIndices := (*[1 << 20]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
 	indices := make([]uint32, num)
----------------
Looks like the Go documentation link above recommends using `1 << 28`. Seems like a really awkward pattern, but I'm not a Go expert...


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58030/new/

https://reviews.llvm.org/D58030





More information about the llvm-commits mailing list