[PATCH] D54986: Make CodeGen choose when to emit vtables.
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 27 19:56:55 PST 2018
rsmith marked an inline comment as done.
rsmith added inline comments.
================
Comment at: lib/CodeGen/CodeGenModule.cpp:3991-3992
+ if (auto *MD = dyn_cast<CXXMethodDecl>(D)) {
+ // FIXME: There's no reason to do this if the key function is inline.
+ // Formally, the ABI requires it, but the difference is not observable.
+ if (declaresSameEntity(Context.getCurrentKeyFunction(MD->getParent()), MD))
----------------
@rjmccall Is there any reason we (from the CodeGen perspective) should treat an inline key function as emitting the vtable? I can't think of any reason to do so -- it's not in a comdat with the vtable or anything like that, so every translation unit that emits a reference to the vtable should emit its own copy anyway.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54986/new/
https://reviews.llvm.org/D54986
More information about the cfe-commits
mailing list