transform: fix error in interface lowering pass
It appears that LLVM can sometimes recognize that multiple calls to runtime.interfaceMethod can be merged into one. When that happens, the interface lowering pass shows an error as it didn't expect that situation. Luckily the fix is very easy.
Этот коммит содержится в:
родитель
b4dddfe439
коммит
3b1759f463
1 изменённых файлов: 21 добавлений и 24 удалений
|
@ -317,11 +317,7 @@ func (p *lowerInterfacesPass) run() error {
|
|||
}
|
||||
inttoptr := inttoptrs[0]
|
||||
calls := getUses(inttoptr)
|
||||
if len(calls) != 1 || calls[0].IsACallInst().IsNil() {
|
||||
return errorAt(use, "internal error: expected exactly one call use of runtime.interfaceMethod")
|
||||
}
|
||||
call := calls[0]
|
||||
|
||||
for _, call := range calls {
|
||||
// Set up parameters for the call. First copy the regular params...
|
||||
params := make([]llvm.Value, call.OperandsCount())
|
||||
paramTypes := make([]llvm.Type, len(params))
|
||||
|
@ -344,6 +340,7 @@ func (p *lowerInterfacesPass) run() error {
|
|||
call.ReplaceAllUsesWith(retval)
|
||||
}
|
||||
call.EraseFromParentAsInstruction()
|
||||
}
|
||||
inttoptr.EraseFromParentAsInstruction()
|
||||
use.EraseFromParentAsInstruction()
|
||||
}
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче