@@ -989,9 +989,18 @@ static void output_insn(struct function *fn, struct instruction *insn)
case OP_CBR:
output_op_cbr(fn, insn);
break;
- case OP_SYMADDR:
- assert(0);
+ case OP_SYMADDR: {
+ LLVMValueRef res, src;
+ LLVMTypeRef dtype;
+ char name[64];
+
+ src = pseudo_to_value(fn, insn->type, insn->symbol);
+ dtype = symbol_type(insn->type);
+ pseudo_name(insn->target, name);
+ res = LLVMBuildBitCast(fn->builder, src, dtype, name);
+ insn->target->priv = res;
break;
+ }
case OP_SETVAL:
output_op_setval(fn, insn);
break;
sparse-llvm don't yet support OP_SYMADDR instructions. Fix this by teaching it how to handle those. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- sparse-llvm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)