mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 11:37:46 +00:00
Simplify a bit of code
This commit is contained in:
+1
-6
@@ -240,12 +240,7 @@ func (c *Compiler) Parse(mainPath string, buildTags []string) error {
|
||||
// Declare all globals. These will get an initializer when parsing "package
|
||||
// initializer" functions.
|
||||
for _, g := range c.ir.Globals {
|
||||
typ := g.g.Type()
|
||||
if typPtr, ok := typ.(*types.Pointer); ok {
|
||||
typ = typPtr.Elem()
|
||||
} else {
|
||||
return errors.New("global is not a pointer")
|
||||
}
|
||||
typ := g.g.Type().(*types.Pointer).Elem()
|
||||
llvmType, err := c.getLLVMType(typ)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user