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,
803
803
}
804
804
805
805
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
+
806
812
// FIXME(PR43094): When merging comdat groups, lld can select a local
807
813
// symbol as the signature symbol even though it cannot be accessed
808
814
// outside that symbol's TU. The relative vtables ABI would make
@@ -831,16 +837,9 @@ void CodeGenVTables::addVTableComponent(ConstantArrayBuilder &builder,
831
837
832
838
// Pure virtual member functions.
833
839
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 ());
844
843
fnPtr = PureVirtualFn;
845
844
846
845
// Deleted virtual member functions.
You can’t perform that action at this time.
0 commit comments