[PATCH] D44406: [CodeView] Emit HasConstructorOrDestructor class option
Aaron Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 13 20:17:32 PDT 2018
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
More information about the llvm-commits
mailing list