Skip to content

Commit 6eeb45f

Browse files
committed
Apply comments
1 parent c0eb128 commit 6eeb45f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

clang/lib/CodeGen/CGVTables.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,12 @@ void CodeGenVTables::addVTableComponent(ConstantArrayBuilder &builder,
803803
}
804804

805805
auto getSpecialVirtualFn = [&](StringRef name) -> llvm::Constant * {
806+
// There is no guarantee that special function for handling pure virtual
807+
// calls will be provided by a SYCL backend compiler and therefore we
808+
// simply emit nullptr here.
809+
if (CGM.getLangOpts().SYCLIsDevice)
810+
return llvm::ConstantPointerNull::get(CGM.GlobalsInt8PtrTy);
811+
806812
// FIXME(PR43094): When merging comdat groups, lld can select a local
807813
// symbol as the signature symbol even though it cannot be accessed
808814
// outside that symbol's TU. The relative vtables ABI would make
@@ -831,16 +837,9 @@ void CodeGenVTables::addVTableComponent(ConstantArrayBuilder &builder,
831837

832838
// Pure virtual member functions.
833839
if (cast<CXXMethodDecl>(GD.getDecl())->isPureVirtual()) {
834-
if (!PureVirtualFn) {
835-
// There is no guarantee that special function for handling pure virtual
836-
// calls will be provided by a SYCL backend compiler and therefore we
837-
// simply emit nullptr here.
838-
if (CGM.getLangOpts().SYCLIsDevice)
839-
PureVirtualFn = llvm::ConstantPointerNull::get(CGM.GlobalsInt8PtrTy);
840-
else
841-
PureVirtualFn =
842-
getSpecialVirtualFn(CGM.getCXXABI().GetPureVirtualCallName());
843-
}
840+
if (!PureVirtualFn)
841+
PureVirtualFn =
842+
getSpecialVirtualFn(CGM.getCXXABI().GetPureVirtualCallName());
844843
fnPtr = PureVirtualFn;
845844

846845
// Deleted virtual member functions.

0 commit comments

Comments
 (0)