What is a FunctionType really?

This may sound weird, but what exactly is a FunctionType? That is, in
terms of memory, or underlying value, what does the FunctionType
actually represent. At first I though it might be a pointer, but it is
not -- since you have to wrap a PointerType around it to use as such.
Can a FunctionType value actually exist, or is strictly an abstract
concept? In particular, can I actually directly define some type to be a
function type, or must I always declare it as a pointer to that type?

This may sound weird, but what exactly is a FunctionType? That is, in
terms of memory, or underlying value, what does the FunctionType
actually represent. At first I though it might be a pointer, but it is
not -- since you have to wrap a PointerType around it to use as such.
Can a FunctionType value actually exist, or is strictly an abstract
concept? In particular, can I actually directly define some type to be a
function type, or must I always declare it as a pointer to that type?

Types, function or otherwise, have no in-memory representation. They
merely describe how bits should be interpreted.

- David

This is what I'm asking about the FunctionType. If I have a Pointer to a
FunctionType it is clear how the bits should be interpreted, but what
does the FunctionType it self say about the bits, if anything?

In terms of use, can I create variables which are of FunctionType directly?

Types, function or otherwise, have no in-memory representation. They
merely describe how bits should be interpreted.

This is what I'm asking about the FunctionType. If I have a Pointer to a
FunctionType

It's a pointer of some FunctionType (ie: it points to a function),
rather than a pointer to a FunctionType (it doesn't point to
FunctionType).

Unless you're literally talking about a "FunctionType*", which is a
pointer /to/ a FunctionType, but that doesn't exist in the running
LLVM code.

it is clear how the bits should be interpreted, but what
does the FunctionType it self say about the bits, if anything?

If you have a pointer of FunctionType then the FunctionType tells you
how you call that function (ie: with how many arguments & of what
type).

In terms of use, can I create variables which are of FunctionType directly?

values in the SSA sense, or variable in the LLVM C++ API sense?

An SSA value of FunctionType is an llvm::Function.

As for variables in the LLVM C++ API sense, no, you get FunctionType*s
from FunctionType::get, you don't have direct FunctionType variables,
only pointers to them.