sparse-llvm handling of variadic function calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

With the provision of type information in pseudo values, the following
modification allows variadic functions to be passed arguments
correctly. I have tested this with printf() mainly - probably more
rigorous testing is needed.

In output_op_call():

 FOR_EACH_PTR(insn->arguments, arg) {
  struct symbol *ftype = get_function_basetype(insn->fntype);
  LLVMValueRef value;
  if (arg->type == PSEUDO_VAL) {
   struct symbol *atype;
   atype = get_nth_symbol(ftype->arguments, i);
   /* Value pseudos do not have type information. */
   /* Use the function prototype to get the type. */
   if (atype)
    value = val_to_value(C, fn, arg->value, atype);
   else
    value = val_to_value(C, fn, arg->value, arg->sym);
  }
  else {
   value = pseudo_to_value(C, fn, insn, arg);
  }
  args[i++] = value;
 } END_FOR_EACH_PTR(arg);
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux