[PATCH] D44406: [CodeView] Emit HasConstructorOrDestructor class option
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 14 10:00:03 PDT 2018
rnk added a comment.
It sounds like the criteria for this flag is "has a non-trivial constructor". Here's two examples that show the difference:
struct Foo {
Foo() = default;
Foo(const Foo &o) = default;
int m;
} f;
struct Bar {
int m = 0;
} b;
Foo doesn't have the flag, even though it has two user-declared constructors, because they are trivial. Bar has the flag even though it has no user-declared constructors, because the default ctor must zero initialize the object.
Bar is interesting because Clang currently doesn't mark the "Bar" DICompositeType in any way that would let us set this flag correctly. It doesn't create a DISubprogram for Bar's non-trivial default ctor. MSVC does, so we might want to make Clang go out of its way to describe all the non-trivial special members of a class.
Repository:
rL LLVM
https://reviews.llvm.org/D44406
More information about the llvm-commits
mailing list