<div dir="ltr">This revert reintroduces a wrong-code bug, can you explain what the purpose of the revert is?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 28 Jul 2023 at 03:50, Dmitry Chernenkov via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Dmitry Chernenkov<br>
Date: 2023-07-28T10:49:53Z<br>
New Revision: 3b34d69ac7a643742364be3591b324ddd14ef9aa<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/3b34d69ac7a643742364be3591b324ddd14ef9aa" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/3b34d69ac7a643742364be3591b324ddd14ef9aa</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/3b34d69ac7a643742364be3591b324ddd14ef9aa.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/3b34d69ac7a643742364be3591b324ddd14ef9aa.diff</a><br>
<br>
LOG: Revert "For #64088: mark vtable as used if we might emit a reference to it."<br>
<br>
This reverts commit b6847edfc235829b37dd6d734ef5bbfa0a58b6fc.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    clang/lib/Sema/SemaCast.cpp<br>
    clang/test/CodeGenCXX/dynamic-cast-exact.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp<br>
index b338d601db7397..d65ecf52c52310 100644<br>
--- a/clang/lib/Sema/SemaCast.cpp<br>
+++ b/clang/lib/Sema/SemaCast.cpp<br>
@@ -935,14 +935,6 @@ void CastOperation::CheckDynamicCast() {<br>
           << isClangCL;<br>
   }<br>
<br>
-  // For a dynamic_cast to a final type, IR generation might emit a reference<br>
-  // to the vtable.<br>
-  if (DestRecord) {<br>
-    auto *DestDecl = DestRecord->getAsCXXRecordDecl();<br>
-    if (DestDecl->isEffectivelyFinal())<br>
-      Self.MarkVTableUsed(OpRange.getBegin(), DestDecl);<br>
-  }<br>
-<br>
   // Done. Everything else is run-time checks.<br>
   Kind = CK_Dynamic;<br>
 }<br>
<br>
diff  --git a/clang/test/CodeGenCXX/dynamic-cast-exact.cpp b/clang/test/CodeGenCXX/dynamic-cast-exact.cpp<br>
index bd283e85101b4b..676aa975a72686 100644<br>
--- a/clang/test/CodeGenCXX/dynamic-cast-exact.cpp<br>
+++ b/clang/test/CodeGenCXX/dynamic-cast-exact.cpp<br>
@@ -76,12 +76,3 @@ H *exact_multi(A *a) {<br>
   // CHECK: phi ptr [ %[[RESULT]], %[[LABEL_NOTNULL]] ], [ null, %[[LABEL_FAILED]] ]<br>
   return dynamic_cast<H*>(a);<br>
 }<br>
-<br>
-namespace GH64088 {<br>
-  // Ensure we mark the B vtable as used here, because we're going to emit a<br>
-  // reference to it.<br>
-  // CHECK: define {{.*}} @_ZN7GH640881BD0<br>
-  struct A { virtual ~A(); };<br>
-  struct B final : A { virtual ~B() = default; };<br>
-  B *cast(A *p) { return dynamic_cast<B*>(p); }<br>
-}<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>