[Lldb-commits] [PATCH] D133906: [lldb] Generate lldb-forward with .def file

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 19 06:16:30 PDT 2022


labath added a comment.

In D133906#3792666 <https://reviews.llvm.org/D133906#3792666>, @JDevlieghere wrote:

> In D133906#3792230 <https://reviews.llvm.org/D133906#3792230>, @labath wrote:
>
>>   // no .def file
>>   #define LLDB_FORWARD_CLASS(cls) \
>>     namespace lldb_private { class cls; } \
>>     namespace lldb {  using cls##SP = std::shared_ptr<lldb_private::cls>; } \
>>     ...
>>   
>>   LLDB_FORWARD_CLASS(Foo)
>>   LLDB_FORWARD_CLASS(Bar)
>>   ...
>
> Works for me, but I don't see how that would help with go-to definition. Xcode still won't show you the macro expansion so there's nothing to click through, which was Jim's complaint.

Right, I see. I misunderstood the problem somehow. That said, I can imagine Xcode offering a (clickable) tooltip showin the macro expansion in this case. I know of an IDE that does that, and it's pretty cool.

In D133906#3793505 <https://reviews.llvm.org/D133906#3793505>, @clayborg wrote:

> Wouldn't this also slow down compilation a bit? Each file that #include "lldb-forward.h" will not do a large amount of preprocessor stuff for each and every file that is compiled that includes this?

Technically yes, but I very much doubt the difference will be measurable. The slowness of compiling c++ comes from instantiating templates and other fancy stuff. The preprocessor step is ridiculously fast.


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

https://reviews.llvm.org/D133906



More information about the lldb-commits mailing list