Skip to content

Commit 503b88f

Browse files
authored
[SYCL-WEB] Sync VTable related customization with sycl branch (#10993)
Fixed CodeGenSYCL/virtual-types.cpp
1 parent 22fc11b commit 503b88f

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,11 +3874,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
38743874
VTable = CGM.getModule().getNamedAlias(VTableName);
38753875

38763876
if (!VTable)
3877-
#ifdef INTEL_SYCL_OPAQUEPOINTER_READY
3878-
VTable = CGM.getModule().getOrInsertGlobal(VTableName, CGM.Int8PtrTy);
3879-
#else // INTEL_SYCL_OPAQUEPOINTER_READY
38803877
VTable = CGM.CreateRuntimeVariable(CGM.DefaultInt8PtrTy, VTableName);
3881-
#endif // INTEL_SYCL_OPAQUEPOINTER_READY
38823878

38833879
CGM.setDSOLocal(cast<llvm::GlobalValue>(VTable->stripPointerCasts()));
38843880

@@ -3897,18 +3893,12 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
38973893
llvm::ConstantExpr::getInBoundsGetElementPtr(CGM.Int8Ty, VTable, Eight);
38983894
} else {
38993895
llvm::Constant *Two = llvm::ConstantInt::get(PtrDiffTy, 2);
3900-
#ifdef INTEL_SYCL_OPAQUEPOINTER_READY
3901-
VTable = llvm::ConstantExpr::getInBoundsGetElementPtr(CGM.Int8PtrTy,
3902-
#else // INTEL_SYCL_OPAQUEPOINTER_READY
39033896
VTable = llvm::ConstantExpr::getInBoundsGetElementPtr(CGM.DefaultInt8PtrTy,
3904-
#endif // INTEL_SYCL_OPAQUEPOINTER_READY
39053897
VTable, Two);
39063898
}
3907-
#ifdef INTEL_SYCL_OPAQUEPOINTER_READY
3908-
VTable = llvm::ConstantExpr::getBitCast(VTable, CGM.GlobalsInt8PtrTy);
3909-
#else // INTEL_SYCL_OPAQUEPOINTER_READY
3899+
#ifndef INTEL_SYCL_OPAQUEPOINTER_READY
39103900
VTable = llvm::ConstantExpr::getBitCast(VTable, CGM.DefaultInt8PtrTy);
3911-
#endif // INTEL_SYCL_OPAQUEPOINTER_READY
3901+
#endif
39123902

39133903
Fields.push_back(VTable);
39143904
}

0 commit comments

Comments
 (0)