[PATCH] D41743: Debug Info: Support DW_AT_calling_convention on composite types.

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 15:43:06 PST 2018


aprantl created this revision.
aprantl added reviewers: echristo, dblaikie, probinson.
aprantl added a project: debug-info.
Herald added a subscriber: JDevlieghere.

This implements the DWARF 5 feature described at
http://www.dwarfstd.org/ShowIssue.php?issue=141215.1

This allows a consumer to understand whether a composite data type is
trivially copyable and thus should be passed by value instead of by
reference. The canonical example is being able to distinguish the
following two types:

  // S is not trivially copyable because of the explicit destructor.
  struct S {
     ~S() {}
  };
  
  // T is a POD type.
  struct T {
    ~T() = default;
  };

To avoid bloating the debug info with calling convention attributes,
this patch only adds them were the calling convention is not obvious
from the context.

Implicitly by value is everything that clearly looks like a C struct, i.e.:

- Non-C++ record types.
- Types that define none of destructor, copy/move constructor, copy/move assignment operator.

Implicitly by reference is everything clearly looks like a non-pod type:

- Types that define a destructor, a copy constructor, and a copy assignment operator.


Repository:
  rL LLVM

https://reviews.llvm.org/D41743

Files:
  lib/CodeGen/CGDebugInfo.cpp
  test/CodeGenCXX/debug-info-composite-cc.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41743.128664.patch
Type: text/x-patch
Size: 3700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180104/6517157d/attachment-0001.bin>


More information about the cfe-commits mailing list