akhuang marked an inline comment as done.
akhuang added inline comments.

================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:992
       getTagForRecord(RD), RDName, Ctx, DefUnit, Line, 0, Size, Align,
       llvm::DINode::FlagFwdDecl, Identifier);
   if (CGM.getCodeGenOpts().DebugFwdTemplateParams)
----------------
rnk wrote:
> One alternative would be to add `llvm::DINode::FlagNonTrivial` here if the 
> type is complete and not trivial.
> 
> There is the case where the the compiler has to emit a method type when the 
> class has been forward declared, and that could still lead to duplicate 
> records. For example:
> ```
> class Returned;
> class Foo {
>   Foo();
>   Returned bar();
> };
> Foo::Foo() {}
> ```
> In this example, clang will have to describe the method type of Foo::bar, but 
> it will not have access to Returned. I think in practice this won't come up, 
> because Foo::bar will be defined in the same file as the constructor.
I suppose this would be a lot simpler. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75215



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to