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?<br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 13, 2018 at 8:17 PM Aaron Smith via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">asmith added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1769<br>
<br>
+  for (const DINode *Element : Ty->getElements()) {<br>
+    if (auto *Method = dyn_cast_or_null<DISubprogram>(Element)) {<br>
----------------<br>
zturner wrote:<br>
> How does cl behave if you have copy constructor or move constructor?  Does it set this flag then?<br>
><br>
> 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?<br>
><br>
> ```<br>
> struct A {<br>
>   int x;<br>
> };<br>
><br>
> struct B {<br>
>   B() = default;<br>
>   int x;<br>
> };<br>
><br>
> struct C {<br>
>   C(const C &) {}<br>
> };<br>
><br>
> struct D {<br>
>   std::string S;<br>
> };<br>
> ```<br>
><br>
> 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).<br>
struct A {<br>
  int x;            // Will have compiler generated SMF ctor/dtor<br>
};<br>
<br>
struct B {<br>
  B() = default;    // Using default (compiler generated) SMF ctor/dtor<br>
  int x;<br>
};<br>
<br>
struct C {<br>
  C(const C &) {}   // User defined SMF copy ctor<br>
};<br>
<br>
struct D {<br>
  std::string S;    // Will have compiler generated SMF ctor/dtor<br>
};<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D44406" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44406</a><br>
<br>
<br>
<br>
</blockquote></div>