aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-08-30 18:10:25 +0300
committerPekka Enberg <penberg@kernel.org>2011-08-30 18:10:25 +0300
commitbe40b1a0e49a97f084c67d2ffc866b1445445d44 (patch)
tree0a391700d7d1f7e311d16cc349c3245510c4b460
parentb37c0754eedb7e3039902caa3da4b192a03695a4 (diff)
downloadsparse-be40b1a0e49a97f084c67d2ffc866b1445445d44.tar.gz
sparse, llvm: Don't redefine module local functions
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--sparse-llvm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sparse-llvm.c b/sparse-llvm.c
index bf7389c9..a4523795 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -523,6 +523,11 @@ static LLVMValueRef get_function(struct function *fn, struct instruction *insn)
return f->func; /* found match; return */
} END_FOR_EACH_PTR(f);
+ /* search for module local functions */
+ func = LLVMGetNamedFunction(fn->module, buffer);
+ if (func)
+ return func;
+
/* build function type definition */
LLVMTypeRef func_type = get_func_type(fn, insn);