diff options
| author | Pekka Enberg <penberg@kernel.org> | 2011-10-24 14:11:13 +0300 |
|---|---|---|
| committer | Pekka Enberg <penberg@kernel.org> | 2011-10-24 14:59:37 +0300 |
| commit | e6981551345b7284f6995556398b3564d02afc42 (patch) | |
| tree | 01f509a51ff6d48cf4ddcb284b82c73a2fd0d464 /validation/backend | |
| parent | 30f5aa58c15d8a2761e703424e8400943916a065 (diff) | |
| download | sparse-dev-e6981551345b7284f6995556398b3564d02afc42.tar.gz | |
sparse, llvm: Fix 'void *' pointer code generation
Sparse front-end generates SYM_PTR with SYM_BASETYPE with bit_size set to -1
for "void *" pointers. We currently map that to LLVMVoidType() but that no
longer works with LLVM Subversion trunk:
$ ./sparse-llvm validation/backend/struct.c
sparse-llvm: Type.cpp:676: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.
Aborted
Fix the issue by treating 'void *' as 'char *' as suggested by Linus:
On Mon, 24 Oct 2011, Linus Torvalds wrote:
> Why bits_per_pointer? Isn't this the "base type" of void *? A more
> logical choice would seem to be to make it equivalent to "char *", and
> just make it fall through to the "case 8" case?
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation/backend')
0 files changed, 0 insertions, 0 deletions
