sparse, llvm: use LLVM_DEFAULT_TARGET_TRIPLE

Stick to LLVM_DEFAULT_TARGET_TRIPLE since LLVM_HOSTTRIPLE doesn't exist
on trunk anymore.  Define LLVM_DEFAULT_TARGET_TRIPLE to LLVM_HOSTTRIPLE
for building with older LLVM.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
sparse, llvm: fix array size

The array size should be ->bit_size over that of its element type,
rather than ->bit_size / 8.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
sparse, llvm: cache symbol_type() result

Cache symbol_type() result in ->aux to avoid recomputation.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
sparse, llvm: fix struct name generation

Avoid null pointer dereference when ->ident is null (e.g., anonymous
struct).  Also, use ->aux to avoid recursion.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
sparse, llvm: set more data attributes

Set const, thread_local, and alignment for global variables.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
sparse, llvm: die if error

Stop code generation if anything is wrong in front-end.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>