Skip to content

Commit ec238c6

Browse files
committed
stop using the global context for gc types
1 parent 955e11f commit ec238c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/gctype/gctype.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func NewTyper(ctx llvm.Context, mod llvm.Module, td llvm.TargetData) *Typer {
5656
return &Typer{
5757
tcache: make(map[llvm.Type]llvm.Value),
5858
td: td,
59+
ctx: ctx,
5960
mod: mod,
6061
uintptr: ctx.IntType(int(td.TypeSizeInBits(ptr))),
6162
i8: ctx.Int8Type(),
@@ -72,6 +73,8 @@ type Typer struct {
7273
// td is the target platform data.
7374
td llvm.TargetData
7475

76+
ctx llvm.Context
77+
7578
mod llvm.Module
7679

7780
uintptr, i8 llvm.Type
@@ -137,7 +140,7 @@ func (t *Typer) createGlobal(size uint64, layout []byte) llvm.Value {
137140
bitmapArray := llvm.ConstArray(t.i8, bitmapValues)
138141

139142
// Construct a tuple of the size + the array.
140-
tuple := llvm.ConstStruct([]llvm.Value{
143+
tuple := t.ctx.ConstStruct([]llvm.Value{
141144
llvm.ConstInt(t.uintptr, size, false),
142145
bitmapArray,
143146
}, false)

0 commit comments

Comments
 (0)