fix bugs found by LLVM assertions

This commit is contained in:
Jaden Weiss
2019-09-12 16:33:14 -04:00
committed by Ayke
parent e0ebc75df2
commit abca3132a9
12 changed files with 163 additions and 24 deletions
+2 -1
View File
@@ -59,6 +59,7 @@ type Config struct {
LDFlags []string // ldflags to pass to cgo
ClangHeaders string // Clang built-in header include path
DumpSSA bool // dump Go SSA, for compiler debugging
VerifyIR bool // run extra checks on the IR
Debug bool // add debug symbols for gdb
GOROOT string // GOROOT
TINYGOROOT string // GOROOT for TinyGo
@@ -2712,7 +2713,7 @@ func (c *Compiler) ExternalInt64AsPtr() error {
// correct calling convention.
fn.SetLinkage(llvm.InternalLinkage)
fn.SetUnnamedAddr(true)
entryBlock := llvm.AddBasicBlock(externalFn, "entry")
entryBlock := c.ctx.AddBasicBlock(externalFn, "entry")
c.builder.SetInsertPointAtEnd(entryBlock)
var callParams []llvm.Value
if fnType.ReturnType() == int64Type {