Skip to content

Commit

Permalink
gofmt cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
axw committed Mar 24, 2012
1 parent aee69d8 commit 99eda83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion llgo/llgo.go
Expand Up @@ -144,4 +144,3 @@ func main() {
}

// vim: set ft=go :

5 changes: 3 additions & 2 deletions methods.go
Expand Up @@ -61,11 +61,12 @@ func (c *compiler) fixMethodDecls(file *ast.File) {
methods := name.Methods
methodname := funcdecl.Name.String()
i := sort.Search(len(methods), func(i int) bool {
return methods[i].Name >= methodname})
return methods[i].Name >= methodname
})
if i < len(methods) && methods[i].Name == methodname {
panic("Duplicate method")
} else if i <= 0 {
name.Methods = append(types.ObjList{method_obj},methods...)
name.Methods = append(types.ObjList{method_obj}, methods...)
} else if i >= len(methods) {
name.Methods = append(methods, method_obj)
} else {
Expand Down
6 changes: 2 additions & 4 deletions stmt.go
Expand Up @@ -170,16 +170,14 @@ func (c *compiler) VisitIfStmt(stmt *ast.IfStmt) {

c.builder.SetInsertPointAtEnd(if_block)
c.VisitBlockStmt(stmt.Body)
if in := if_block.LastInstruction();
in.IsNil() || in.IsATerminatorInst().IsNil() {
if in := if_block.LastInstruction(); in.IsNil() || in.IsATerminatorInst().IsNil() {
c.builder.CreateBr(resume_block)
}

if stmt.Else != nil {
c.builder.SetInsertPointAtEnd(else_block)
c.VisitStmt(stmt.Else)
if in := else_block.LastInstruction();
in.IsNil() || in.IsATerminatorInst().IsNil() {
if in := else_block.LastInstruction(); in.IsNil() || in.IsATerminatorInst().IsNil() {
c.builder.CreateBr(resume_block)
}
}
Expand Down

0 comments on commit 99eda83

Please sign in to comment.