[LLVMdev] More DIFactory questions

Talin viridia at gmail.com
Thu Sep 2 23:43:28 PDT 2010


OK here's another question along these lines: According to the LLVM source
level debugging manual:

The first member of subroutine (tag = DW_TAG_subroutine_type) type elements
is the return type for the subroutine. The remaining elements are the formal
arguments to the subroutine.


Now, when I read "formal arguments" I'm assuming we're talking about DIEs of
type DW_TAG_formal_parameter. However, when I look in the code in
CGDebugInfo.cpp in clang, I see that the arguments are in fact the bare
types, not the formal parameter declarations.

Here's what my code looks like:

  const ParameterList & params = type->params();
  for (ParameterList::const_iterator it = params.begin(); it !=
params.end(); ++it) {
    const ParameterDefn * param = *it;
    DIType ptype = genDIParameterType(param->type());
    ptype = dbgFactory_.CreateDerivedTypeEx(
        dwarf::DW_TAG_formal_parameter,
        dbgCompileUnit_,
        param->name() != NULL ? param->name() : "",
        genDIFile(param),
        getSourceLineNumber(param->location()),
        getSizeOfInBits(param->internalType()->irParameterType()),
        getInt64Val(0),
        getInt64Val(0), 0,
        ptype);
    DASSERT(ptype.Verify());
    args.push_back(ptype);
  }


However, if I go by what's in clang, it seems that the
DW_TAG_formal_parameter is unnecessary. Is this correct?

And I'd still like to see some of these questions addressed in the actual
HTML documentation, as opposed to just responding here on the mailing list.
:)

On Tue, Aug 31, 2010 at 10:32 AM, Devang Patel <dpatel at apple.com> wrote:

>
> On Aug 31, 2010, at 9:03 AM, Talin wrote:
>
> > 4) What is the meaning of the "inlinedAt" argument for DebugLoc::get()?
> Does it mean the location where the inlined code was defined, or the
> location where it was expanded?
>
> the location where it was expanded
> -
> Devang




-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100902/42f962b6/attachment.html>


More information about the llvm-dev mailing list