Skip to content

Commit

Permalink
[SYCL] Tweak v-table suppress patch to work with virtual host calls
Browse files Browse the repository at this point in the history
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 <vladimir.lazarev@intel.com>
  • Loading branch information
vladimirlaz committed Jan 22, 2019
1 parent 4e8c5b0 commit 1fface9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions clang/lib/CodeGen/ModuleBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ namespace {
if (Diags.hasErrorOccurred())
return;

// No VTable usage is legal in SYCL, so don't bother marking them used.
if (Ctx->getLangOpts().SYCL)
return;

Builder->EmitVTable(RD);
}
};
Expand Down
4 changes: 0 additions & 4 deletions clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15013,10 +15013,6 @@ void Sema::MarkVTableUsed(SourceLocation Loc, CXXRecordDecl *Class,
return;
}

// No VTable usage is legal in SYCL, so don't bother marking them used.
if (getLangOpts().SYCL)
return;

// Try to insert this class into the map.
LoadExternalVTableUses();
Class = Class->getCanonicalDecl();
Expand Down

0 comments on commit 1fface9

Please sign in to comment.