Skip to content

Commit c7fdb67

Browse files
aykevldeadprogram
authored andcommitted
compiler: rename biggestInt → capacityType
1 parent b837c94 commit c7fdb67

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

compiler/compiler.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,27 +1748,27 @@ func (c *Compiler) parseExpr(frame *Frame, expr ssa.Value) (llvm.Value, error) {
17481748
// Bounds checking.
17491749
if !frame.fn.IsNoBounds() {
17501750
checkFunc := "sliceBoundsCheckMake"
1751-
biggestInt := c.uintptrType
1752-
biggestIntWidth := biggestInt.IntTypeWidth()
1753-
if sliceLen.Type().IntTypeWidth() > biggestIntWidth || sliceCap.Type().IntTypeWidth() > biggestIntWidth {
1751+
capacityType := c.uintptrType
1752+
capacityTypeWidth := capacityType.IntTypeWidth()
1753+
if sliceLen.Type().IntTypeWidth() > capacityTypeWidth || sliceCap.Type().IntTypeWidth() > capacityTypeWidth {
17541754
// System that is less than 64bit, meaning that the slice make
17551755
// params are bigger than uintptr.
17561756
checkFunc = "sliceBoundsCheckMake64"
1757-
biggestInt = c.ctx.Int64Type()
1758-
biggestIntWidth = biggestInt.IntTypeWidth()
1757+
capacityType = c.ctx.Int64Type()
1758+
capacityTypeWidth = capacityType.IntTypeWidth()
17591759
}
1760-
if sliceLen.Type().IntTypeWidth() < biggestIntWidth {
1760+
if sliceLen.Type().IntTypeWidth() < capacityTypeWidth {
17611761
if expr.Len.Type().(*types.Basic).Info()&types.IsUnsigned != 0 {
1762-
sliceLen = c.builder.CreateZExt(sliceLen, biggestInt, "")
1762+
sliceLen = c.builder.CreateZExt(sliceLen, capacityType, "")
17631763
} else {
1764-
sliceLen = c.builder.CreateSExt(sliceLen, biggestInt, "")
1764+
sliceLen = c.builder.CreateSExt(sliceLen, capacityType, "")
17651765
}
17661766
}
1767-
if sliceCap.Type().IntTypeWidth() < biggestIntWidth {
1767+
if sliceCap.Type().IntTypeWidth() < capacityTypeWidth {
17681768
if expr.Cap.Type().(*types.Basic).Info()&types.IsUnsigned != 0 {
1769-
sliceCap = c.builder.CreateZExt(sliceCap, biggestInt, "")
1769+
sliceCap = c.builder.CreateZExt(sliceCap, capacityType, "")
17701770
} else {
1771-
sliceCap = c.builder.CreateSExt(sliceCap, biggestInt, "")
1771+
sliceCap = c.builder.CreateSExt(sliceCap, capacityType, "")
17721772
}
17731773
}
17741774
maxSliceSize := maxSize

0 commit comments

Comments
 (0)