[llvm] r202188 - Debug info: Support variadic functions.

Adrian Prantl aprantl at apple.com
Wed Feb 26 12:57:06 PST 2014


On Feb 26, 2014, at 12:37, Robinson, Paul <Paul_Robinson at playstation.sony.com> wrote:

>>>> +    DIArray FnArgs = SP.getType().getTypeArray();
>>>> +    if (FnArgs.getElement(FnArgs.getNumElements()-
>> 1).isUnspecifiedParameter()) {
>>>> +      DIE *Ellipsis = new DIE(dwarf::DW_TAG_unspecified_parameters);
>>>> +      Children.push_back(Ellipsis);
>>>> +    }
>>>> +  }
>>>> +
>>> 
>>> This feels awkward here. Thoughts?
>> 
>> We have to insert it immediately after the formal parameters and before
>> the variables. There does not seem to be a more appropriate place than
>> this one.
> 
> Is this a gdb quirk?  DWARF says formal parameters and hopefully
> unspecified_parameters have to be in order, but they don't have to
> be adjacent.
> 

Interesting, you are right. I don’t have anything to back up my previous claim, actually, I think I just assumed that all arguments had to be adjacent. In that case we might as well move this out of the function and just push it to the back of the function scope children.

3.3.4:
> There is no ordering requirement for entries for declarations that are children of subroutine or entry point entries but that do not represent formal parameters. The formal parameter entries may be interspersed with other entries used by formal parameter entries, such as type entries.

thanks for pointing that out!

-- adrian



More information about the llvm-commits mailing list