mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 23:43:40 +00:00
Simplify some code
This commit is contained in:
+2
-8
@@ -1011,10 +1011,7 @@ func (c *Compiler) parseBuiltin(frame *Frame, args []ssa.Value, callName string)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return llvm.Value{}, err
|
return llvm.Value{}, err
|
||||||
}
|
}
|
||||||
typ := arg.Type()
|
typ := arg.Type().Underlying()
|
||||||
if _, ok := typ.(*types.Named); ok {
|
|
||||||
typ = typ.Underlying()
|
|
||||||
}
|
|
||||||
switch typ := typ.(type) {
|
switch typ := typ.(type) {
|
||||||
case *types.Basic:
|
case *types.Basic:
|
||||||
switch typ.Kind() {
|
switch typ.Kind() {
|
||||||
@@ -1722,10 +1719,7 @@ func (c *Compiler) parseBinOp(frame *Frame, binop *ssa.BinOp) (llvm.Value, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Compiler) parseConst(expr *ssa.Const) (llvm.Value, error) {
|
func (c *Compiler) parseConst(expr *ssa.Const) (llvm.Value, error) {
|
||||||
typ := expr.Type()
|
typ := expr.Type().Underlying()
|
||||||
if named, ok := typ.(*types.Named); ok {
|
|
||||||
typ = named.Underlying()
|
|
||||||
}
|
|
||||||
switch typ := typ.(type) {
|
switch typ := typ.(type) {
|
||||||
case *types.Basic:
|
case *types.Basic:
|
||||||
llvmType, err := c.getLLVMType(typ)
|
llvmType, err := c.getLLVMType(typ)
|
||||||
|
|||||||
Reference in New Issue
Block a user