[PATCH] D44406: [CodeView] Emit HasConstructorOrDestructor class option

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 13 20:32:37 PDT 2018


I know what kind of code the compiler will generate in each case, but I
don’t know off the top of my head what the CodeView will look like in each
case. Which ones have the HaveCinstructorOrDesrructor bit? Does your patch
match this behavior?
On Tue, Mar 13, 2018 at 8:17 PM Aaron Smith via Phabricator <
reviews at reviews.llvm.org> wrote:

> asmith added inline comments.
>
>
> ================
> Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1769
>
> +  for (const DINode *Element : Ty->getElements()) {
> +    if (auto *Method = dyn_cast_or_null<DISubprogram>(Element)) {
> ----------------
> zturner wrote:
> > How does cl behave if you have copy constructor or move constructor?
> Does it set this flag then?
> >
> > Also what does this flag really mean?  Does it mean "has
> //non-defaulted// copy constructor or destructor?"  Or "has
> //user-defined// copy-constructor or destructor?"  What would it be set to
> in each of the following cases?
> >
> > ```
> > struct A {
> >   int x;
> > };
> >
> > struct B {
> >   B() = default;
> >   int x;
> > };
> >
> > struct C {
> >   C(const C &) {}
> > };
> >
> > struct D {
> >   std::string S;
> > };
> > ```
> >
> > Can you confirm that with this patch, our behavior matches the behavior
> of cl in each of these cases?  (There may be more cases to think of, but
> this is at least a good starting point).
> struct A {
>   int x;            // Will have compiler generated SMF ctor/dtor
> };
>
> struct B {
>   B() = default;    // Using default (compiler generated) SMF ctor/dtor
>   int x;
> };
>
> struct C {
>   C(const C &) {}   // User defined SMF copy ctor
> };
>
> struct D {
>   std::string S;    // Will have compiler generated SMF ctor/dtor
> };
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D44406
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180314/d3fa521e/attachment.html>


More information about the llvm-commits mailing list