[Lldb-commits] [PATCH] D68130: [lldb] Don't emit artificial constructor declarations as global functions

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 27 14:45:45 PDT 2019


jingham added a comment.

In D68130#1686530 <https://reviews.llvm.org/D68130#1686530>, @shafik wrote:

> So if I look at `ClangASTContext::AddMethodToCXXRecordType(...)` it has the following:
>
>   if (is_artificial)
>     return nullptr; // skip everything artificial
>   
>
> but why? if I look at the godbolt w/ an AST dump <https://godbolt.org/z/P2LjLM> it is not creating as a global function and it would seem that we would want this behavior as well.


IIRC, it is because we can't count on which artificial functions get generated in the debug information in any given CU.  It depends on what gets used.  If we write artificial functions into the AST it makes it harder to unique instances of the class.  And it doesn't matter whether we do or not because the compiler will generate them into the Scratch Context when it needs them.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68130/new/

https://reviews.llvm.org/D68130





More information about the lldb-commits mailing list