File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments