Skip to content

Commit 5282b4e

Browse files
aykevldeadprogram
authored andcommitted
runtime: remove unused file func.go
This was used in the past, but we don't use it anymore.
1 parent 6a25fd4 commit 5282b4e

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

compiler/llvm.go

-7
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,6 @@ func (c *compilerContext) getPointerBitmap(typ llvm.Type, pos token.Pos) *big.In
371371
return big.NewInt(1)
372372
case llvm.StructTypeKind:
373373
ptrs := big.NewInt(0)
374-
if typ.StructName() == "runtime.funcValue" {
375-
// Hack: the type runtime.funcValue contains an 'id' field which is
376-
// of type uintptr, but before the LowerFuncValues pass it actually
377-
// contains a pointer (ptrtoint) to a global. This trips up the
378-
// interp package. Therefore, make the id field a pointer for now.
379-
typ = c.ctx.StructType([]llvm.Type{c.dataPtrType, c.dataPtrType}, false)
380-
}
381374
for i, subtyp := range typ.StructElementTypes() {
382375
subptrs := c.getPointerBitmap(subtyp, pos)
383376
if subptrs.BitLen() == 0 {

interp/memory.go

-13
Original file line numberDiff line numberDiff line change
@@ -824,19 +824,6 @@ func (v rawValue) rawLLVMValue(mem *memoryView) (llvm.Value, error) {
824824
if err != nil {
825825
return llvm.Value{}, err
826826
}
827-
if !field.IsAGlobalVariable().IsNil() {
828-
elementType := field.GlobalValueType()
829-
if elementType.TypeKind() == llvm.StructTypeKind {
830-
// There are some special pointer types that should be used
831-
// as a ptrtoint, so that they can be used in certain
832-
// optimizations.
833-
name := elementType.StructName()
834-
if name == "runtime.funcValueWithSignature" {
835-
uintptrType := ctx.IntType(int(mem.r.pointerSize) * 8)
836-
field = llvm.ConstPtrToInt(field, uintptrType)
837-
}
838-
}
839-
}
840827
structFields = append(structFields, field)
841828
i += mem.r.pointerSize
842829
continue

src/runtime/func.go

-28
This file was deleted.

0 commit comments

Comments
 (0)