fix LLVM assertions from improved blocking
Этот коммит содержится в:
родитель
9aace79298
коммит
b5ecd9cab0
1 изменённых файлов: 8 добавлений и 2 удалений
|
@ -483,7 +483,9 @@ func (c *Compiler) markAsyncFunctions() (needsScheduler bool, err error) {
|
||||||
|
|
||||||
// delete everything after return
|
// delete everything after return
|
||||||
for next := llvm.NextInstruction(retInst); !next.IsNil(); next = llvm.NextInstruction(retInst) {
|
for next := llvm.NextInstruction(retInst); !next.IsNil(); next = llvm.NextInstruction(retInst) {
|
||||||
next.ReplaceAllUsesWith(llvm.Undef(retInst.Type()))
|
if next.Type().TypeKind() != llvm.VoidTypeKind {
|
||||||
|
next.ReplaceAllUsesWith(llvm.Undef(next.Type()))
|
||||||
|
}
|
||||||
next.EraseFromParentAsInstruction()
|
next.EraseFromParentAsInstruction()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,16 +731,20 @@ func (c *Compiler) markAsyncFunctions() (needsScheduler bool, err error) {
|
||||||
if len(yieldCalls) == 0 {
|
if len(yieldCalls) == 0 {
|
||||||
// no yields - we do not have to LLVM-ify this
|
// no yields - we do not have to LLVM-ify this
|
||||||
coroDebugPrintln("skipping", f.Name())
|
coroDebugPrintln("skipping", f.Name())
|
||||||
|
deleteQueue := []llvm.Value{}
|
||||||
for bb := f.EntryBasicBlock(); !bb.IsNil(); bb = llvm.NextBasicBlock(bb) {
|
for bb := f.EntryBasicBlock(); !bb.IsNil(); bb = llvm.NextBasicBlock(bb) {
|
||||||
for inst := bb.FirstInstruction(); !inst.IsNil(); inst = llvm.NextInstruction(inst) {
|
for inst := bb.FirstInstruction(); !inst.IsNil(); inst = llvm.NextInstruction(inst) {
|
||||||
if !inst.IsACallInst().IsNil() && inst.CalledValue() == getCoroutine {
|
if !inst.IsACallInst().IsNil() && inst.CalledValue() == getCoroutine {
|
||||||
// no seperate local task - replace getCoroutine with getParentHandle
|
// no seperate local task - replace getCoroutine with getParentHandle
|
||||||
c.builder.SetInsertPointBefore(inst)
|
c.builder.SetInsertPointBefore(inst)
|
||||||
inst.ReplaceAllUsesWith(c.createRuntimeCall("getParentHandle", []llvm.Value{}, ""))
|
inst.ReplaceAllUsesWith(c.createRuntimeCall("getParentHandle", []llvm.Value{}, ""))
|
||||||
inst.EraseFromParentAsInstruction()
|
deleteQueue = append(deleteQueue, inst)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for _, v := range deleteQueue {
|
||||||
|
v.EraseFromParentAsInstruction()
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче