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>
1 file changed