@@ -895,9 +895,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, insn->symbol);
+ dtype = symbol_type(fn->module, insn->type);
+ pseudo_name(insn->target, name);
+ res = LLVMBuildBitCast(fn->builder, src, dtype, name);
+ insn->target->priv = res;
break;
+ }
case OP_SETVAL:
assert(0);
break;
sparse-llvm don't yet support OP_SYMADDR instructions. Fix this by add the needed support for it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- sparse-llvm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)