Skip to content

Commit 1fface9

Browse files
committed
[SYCL] Tweak v-table suppress patch to work with virtual host calls
The previous fix skipped template instantiations where virtual calls were involved, causing kernel functions used in these base classes to never be discovered, and thus skipped. This patch moves it simply to prevent virtual tables from being emitted, leaving the walking and instantiation of templates in place. Signed-off-by: Vladimir Lazarev <[email protected]>
1 parent 4e8c5b0 commit 1fface9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/CodeGen/ModuleBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ namespace {
284284
if (Diags.hasErrorOccurred())
285285
return;
286286

287+
// No VTable usage is legal in SYCL, so don't bother marking them used.
288+
if (Ctx->getLangOpts().SYCL)
289+
return;
290+
287291
Builder->EmitVTable(RD);
288292
}
289293
};

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15013,10 +15013,6 @@ void Sema::MarkVTableUsed(SourceLocation Loc, CXXRecordDecl *Class,
1501315013
return;
1501415014
}
1501515015

15016-
// No VTable usage is legal in SYCL, so don't bother marking them used.
15017-
if (getLangOpts().SYCL)
15018-
return;
15019-
1502015016
// Try to insert this class into the map.
1502115017
LoadExternalVTableUses();
1502215018
Class = Class->getCanonicalDecl();

0 commit comments

Comments
 (0)