mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
compiler: do not use llvm.GlobalContext()
This is a leftover from a long time ago, when everything was still in the global context. The fact that this uses the global context is most certainly a bug. I have seen occasional crashes in the build-packages-indepedently branch (and PRs based on it) which I suspect are caused by this bug. I think this is a long-dormant bug that only surfaced when doing the compilation steps in parallel.
This commit is contained in:
committed by
Ron Evans
parent
ce8ad3650a
commit
13db2c13e5
@@ -316,14 +316,14 @@ func CompileProgram(lprogram *loader.Program, machine llvm.TargetMachine, config
|
|||||||
c.mod.AddNamedMetadataOperand("llvm.module.flags",
|
c.mod.AddNamedMetadataOperand("llvm.module.flags",
|
||||||
c.ctx.MDNode([]llvm.Metadata{
|
c.ctx.MDNode([]llvm.Metadata{
|
||||||
llvm.ConstInt(c.ctx.Int32Type(), 1, false).ConstantAsMetadata(), // Error on mismatch
|
llvm.ConstInt(c.ctx.Int32Type(), 1, false).ConstantAsMetadata(), // Error on mismatch
|
||||||
llvm.GlobalContext().MDString("Debug Info Version"),
|
c.ctx.MDString("Debug Info Version"),
|
||||||
llvm.ConstInt(c.ctx.Int32Type(), 3, false).ConstantAsMetadata(), // DWARF version
|
llvm.ConstInt(c.ctx.Int32Type(), 3, false).ConstantAsMetadata(), // DWARF version
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
c.mod.AddNamedMetadataOperand("llvm.module.flags",
|
c.mod.AddNamedMetadataOperand("llvm.module.flags",
|
||||||
c.ctx.MDNode([]llvm.Metadata{
|
c.ctx.MDNode([]llvm.Metadata{
|
||||||
llvm.ConstInt(c.ctx.Int32Type(), 1, false).ConstantAsMetadata(),
|
llvm.ConstInt(c.ctx.Int32Type(), 1, false).ConstantAsMetadata(),
|
||||||
llvm.GlobalContext().MDString("Dwarf Version"),
|
c.ctx.MDString("Dwarf Version"),
|
||||||
llvm.ConstInt(c.ctx.Int32Type(), 4, false).ConstantAsMetadata(),
|
llvm.ConstInt(c.ctx.Int32Type(), 4, false).ConstantAsMetadata(),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user