effaddr.asm: Disable now-unsupported construct of [reg*(label2-label)].
x86_bc_insn_calc_len(): Don't destroy NULL intnum.
svn path=/branches/new-optimizer/; revision=1562
check_errors(errwarns, object);
/* Optimize */
- yasm_object_optimize(object, cur_arch);
+ yasm_object_optimize(object, cur_arch, errwarns);
check_errors(errwarns, object);
/* generate any debugging information */
}
void
-yasm_object_optimize(yasm_object *object, yasm_arch *arch)
+yasm_object_optimize(yasm_object *object, yasm_arch *arch,
+ yasm_errwarns *errwarns)
{
yasm_section *sect;
unsigned long bc_index = 0;
if (yasm_bc_calc_len(cur, optimize_add_span, &optd))
saw_error = 1;
+ yasm_errwarn_propagate(errwarns, cur->line);
/* TODO: times */
if (cur->multiple)
/** Optimize an object. Takes the unoptimized object and optimizes it.
* If successful, the object is ready for output to an object file.
* \param object object
- * \note Optimization failures are indicated by this function calling
- * yasm__error_at(); see errwarn.h for details.
+ * \param arch architecture
+ * \param errwarns error/warning set
+ * \note Optimization failures are stored into errwarns.
*/
-void yasm_object_optimize(yasm_object *object, yasm_arch *arch);
+void yasm_object_optimize(yasm_object *object, yasm_arch *arch,
+ yasm_errwarns *errwarns);
/** Determine if a section is absolute or general.
* \param sect section
label
dd 5
label2
-mov ax,[eax+ebx*(label2-label)]
+;mov ax,[eax+ebx*(label2-label)] ; not supported
insn->opcode.len = 1;
}
insn->postop = X86_POSTOP_NONE;
+ yasm_intnum_destroy(num);
}
- yasm_intnum_destroy(num);
}
bc->len += immlen/8;