sparse, llvm: compile: skip function prototypes to avoid SIGSEGV

You can't pass function to LLVMConstNull(), according to
Constant::getNullValue, and sparse-llvm already handle functions differently
(i.e. there will be no call to LLVMConstNull(), but this is not true for
function prototypes, because of how linearize_fn() works:
```
static struct entrypoint *linearize_fn(...)
{
  ...
  if (!base_type->stmt)
    return NULL;
  ...
}
```

```
Constant *Constant::getNullValue(Type *Ty) {
  switch (Ty->getTypeID()) {
  ...
  default:
    // Function, Label, or Opaque type?
    llvm_unreachable("Cannot create a null constant of that type!");
  }
}
```

Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
diff --git a/sparse-llvm.c b/sparse-llvm.c
index ecb5b28..6b41afd 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -1070,6 +1070,13 @@
 	return data;
 }
 
+static int is_prototype(struct symbol *sym)
+{
+	if (sym->type == SYM_NODE)
+		sym = sym->ctype.base_type;
+	return sym && sym->type == SYM_FN && !sym->stmt;
+}
+
 static int compile(LLVMModuleRef module, struct symbol_list *list)
 {
 	struct symbol *sym;
@@ -1077,6 +1084,10 @@
 	FOR_EACH_PTR(list, sym) {
 		struct entrypoint *ep;
 		expand_symbol(sym);
+
+		if (is_prototype(sym))
+			continue;
+
 		ep = linearize_symbol(sym);
 		if (ep)
 			output_fn(module, ep);