interp: fix compile-time alloc linkage
This makes sure compile-time allocations (globals with the $alloc suffix) can be eliminated when unused.
Этот коммит содержится в:
родитель
b4be9e033a
коммит
2cd9846cc9
1 изменённых файлов: 1 добавлений и 0 удалений
|
@ -215,6 +215,7 @@ func (fr *frame) evalBasicBlock(bb, incoming llvm.BasicBlock, indent string) (re
|
||||||
}
|
}
|
||||||
alloc := llvm.AddGlobal(fr.Mod, allocType, fr.pkgName+"$alloc")
|
alloc := llvm.AddGlobal(fr.Mod, allocType, fr.pkgName+"$alloc")
|
||||||
alloc.SetInitializer(getZeroValue(allocType))
|
alloc.SetInitializer(getZeroValue(allocType))
|
||||||
|
alloc.SetLinkage(llvm.InternalLinkage)
|
||||||
result := &GlobalValue{
|
result := &GlobalValue{
|
||||||
Underlying: alloc,
|
Underlying: alloc,
|
||||||
Eval: fr.Eval,
|
Eval: fr.Eval,
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче