[PATCH]: Remove DW_TAG_arg_variable and DW_TAG_auto_variable

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Jul 30 17:26:48 PDT 2015


These patches remove the two remaining fake DWARF tags, which we use to
differentiate between types of variables.  However, they're not
necessary.  The `arg:` field fully encodes whether a local variable is a
parameter.

The other obvious option (and my original plan here) was to create two
subclasses `DIAutoVariable` and `DIParameterVariable`.  These classes
would be so similar that I'm not sure that's worthwhile until we're
tablegen'ing these.

Here's what's in the patches:

  - 0001: Update the DIBuilder API to use `createAutoVariable()` and
    `createParameterVariable()` (instead of `createLocalVariable()`).
  - 0002: clang side of 0001.
  - 0003: Strip the fake tags from the IR.
  - 0004: LLVM testcases for 0003 updated via script (I'll squash this).
  - 0005: Clang testcases for 0003.

(Note: a follow-up could change `DILocalVariable::DILocalVariable()` to
set the tag to `DW_TAG_formal_parameter` instead of `DW_TAG_variable`
(as appropriate), instead of having that logic magically in the backend
in `DbgVariable`.  I left a FIXME to that effect.)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-DI-Rewrite-the-DIBuilder-local-variable-API-llvm.patch
Type: application/octet-stream
Size: 9533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/712e852e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-DI-Use-successors-of-createLocalVariable-clang.patch
Type: application/octet-stream
Size: 7198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/712e852e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-DI-Use-DW_TAG_variable-for-DILocalVariable-llvm.patch
Type: application/octet-stream
Size: 32241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/712e852e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Testcases-DI-Remove-the-DW_TAG_auto-arg_variabl-llvm.patch
Type: application/octet-stream
Size: 466927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/712e852e/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-DI-Update-testcases-for-LLVM-assembly-change-clang.patch
Type: application/octet-stream
Size: 20326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/712e852e/attachment-0004.obj>


More information about the llvm-commits mailing list