aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGVTables.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-06-14 16:17:31 -0700
committerNico Weber <thakis@chromium.org>2023-06-14 16:17:42 -0700
commitdbdd6372b7af2f6df5f41d19d966e6bac1b30208 (patch)
treed9792080a1832da50780561da10c08e22068e3ea /clang/lib/CodeGen/CGVTables.cpp
parent4cfc33b8b5841bdaa6fd195cfa4318e11e9b3d46 (diff)
downloadllvm-dbdd6372b7af2f6df5f41d19d966e6bac1b30208.zip
llvm-dbdd6372b7af2f6df5f41d19d966e6bac1b30208.tar.gz
llvm-dbdd6372b7af2f6df5f41d19d966e6bac1b30208.tar.bz2
Revert "[ABI] [C++20] [Modules] Don't generate vtable if the class is defined in other module unit"
Breaks check-clang on win and mac, see comments on https://reviews.llvm.org/D150023 This reverts commit d8a36b00d198fdc2ea866ea5da449628db07070f. Also revert follow-up "[NFC] skip the test modules-vtable.cppm on windows" This reverts commit baf0b12ca6c624b2a59aa6f2fd0310c72d35ac56.
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index fb0276a..32259d1 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -1172,16 +1172,9 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) {
if (!keyFunction)
return false;
- const FunctionDecl *Def;
// Otherwise, if we don't have a definition of the key function, the
// vtable must be defined somewhere else.
- if (!keyFunction->hasBody(Def))
- return true;
-
- assert(Def && "The body of the key function is not assigned to Def?");
- // If the non-inline key function comes from another module unit, the vtable
- // must be defined there.
- return Def->isInAnotherModuleUnit() && !Def->isInlineSpecified();
+ return !keyFunction->hasBody();
}
/// Given that we're currently at the end of the translation unit, and