[PATCH] D158538: [MS-ABI] Remove comdat attribute for inheriting ctor.

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 28 13:00:45 PDT 2023


jyu2 added a comment.

Hi @rnk,

Thank you so much for the suggestion.

>> Before we do that, you should be able to delete the logic in CodeGenModule::getFunctionLinkage to handle inheriting constructor thunks. Your change should have the same effect. Can you do that, and check that it passes tests? If we do that, we're don't have to accumulate extra special case code, we've just moved the special case code earlier, up from codegen into the earlier linkage calculation.

Yes, you are right.   I remove the code in CodeGenModule.cpp, the test passes for check-clang.



================
Comment at: clang/test/CodeGenCXX/ms-inheriting-ctor.cpp:41
+
+// CHECK-LABEL: define internal noundef ptr @"??0?$B at _N@@QEAA at AEBVF@@AEBUA@@@Z"(ptr noundef nonnull returned align 1 dereferenceable(1) %this, ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) unnamed_addr #2 align 2
+// CHECK-LABEL: define linkonce_odr dso_local noundef ptr @"??0?$c at _NUb@@@@QEAA at AEBVF@@AEBUA@@@Z"(ptr noundef nonnull returned align 1 dereferenceable(1) %this, ptr noundef nonnull align 1 dereferenceable(1) %p1, ptr noundef nonnull align 1 dereferenceable(1) %d) unnamed_addr #2 comdat align 2
----------------
rnk wrote:
> To make this less fragile, can you come up with a way to use `CHECK-NOT: comdat` since that's the key thing we're testing for here? You will need some subsequent anchor like `entry:` or something else.
Thanks.  I changed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158538



More information about the cfe-commits mailing list