[Lldb-commits] [PATCH] D143652: [lldb][DWARFASTParserClang] Attach linkage name to ctors/dtors if missing

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 13 06:07:44 PST 2023


labath added inline comments.


================
Comment at: lldb/test/API/lang/cpp/external_ctor_dtor_lookup/TestExternalCtorDtorLookup.py:28
+# CHECK:           |-CXXConstructorDecl {{.*}} Wrapper 'void ()'
+# CHECK-NEXT:      | `-AsmLabelAttr {{.*}} Implicit "_ZN7WrapperI3FooEC1B4testEv"
+# CHECK-NEXT:      `-CXXDestructorDecl {{.*}} ~Wrapper 'void ()'
----------------
I think this could be a bit of a problem, because (as you've probably found out by now) there are multiple versions of a single constructor, and the asm label seems to cause clang to coalesce them. In the simple test case below that doesn't matter, as the two constructors are identical, but things might be different if the class had virtual bases. (i.e., it could cause us to call the wrong constructor and blow up).


================
Comment at: lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h:6
+public:
+  [[gnu::abi_tag("test")]] Wrapper(){};
+
----------------
superfluous semicolon


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143652



More information about the lldb-commits mailing list