some deletions
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / functions / stub.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/functions/stub.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/functions/stub.go
deleted file mode 100644 (file)
index 4d5de10..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package functions
-
-import (
-       "honnef.co/go/tools/ir"
-)
-
-// IsStub reports whether a function is a stub. A function is
-// considered a stub if it has no instructions or if all it does is
-// return a constant value.
-func IsStub(fn *ir.Function) bool {
-       for _, b := range fn.Blocks {
-               for _, instr := range b.Instrs {
-                       switch instr.(type) {
-                       case *ir.Const:
-                               // const naturally has no side-effects
-                       case *ir.Panic:
-                               // panic is a stub if it only uses constants
-                       case *ir.Return:
-                               // return is a stub if it only uses constants
-                       case *ir.DebugRef:
-                       case *ir.Jump:
-                               // if there are no disallowed instructions, then we're
-                               // only jumping to the exit block (or possibly
-                               // somewhere else that's stubby?)
-                       default:
-                               // all other instructions are assumed to do actual work
-                               return false
-                       }
-               }
-       }
-       return true
-}