aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2012-06-08 15:24:12 +0300
committerPekka Enberg <penberg@kernel.org>2012-06-08 23:31:35 +0300
commitee2ca87d9bd18850518c8bca95d61df6010d9351 (patch)
tree3bd961e6a753960c99f494c3bb12fe808ed5ee21
parent0bf990ff7f1f9457bcda08049d012d23b0d60dfb (diff)
downloadsparse-ee2ca87d9bd18850518c8bca95d61df6010d9351.tar.gz
sparse, llvm: Simplify output_data() type logic
Use LLVMTypeOf() in output_data() to simplify type handling logic. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Christopher Li <sparse@chrisli.org> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--sparse-llvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sparse-llvm.c b/sparse-llvm.c
index 9226a212..a39bc027 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -1192,7 +1192,7 @@ static LLVMValueRef output_data(LLVMModuleRef module, struct symbol *sym)
name = show_ident(sym->ident);
- data = LLVMAddGlobal(module, symbol_type(module, sym->ctype.base_type), name);
+ data = LLVMAddGlobal(module, LLVMTypeOf(initial_value), name);
LLVMSetLinkage(data, data_linkage(sym));