Skip to content

[SYCL-WEB] Sync VTable related customization with sycl branch #10993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions clang/lib/CodeGen/ItaniumCXXABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3874,11 +3874,7 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
VTable = CGM.getModule().getNamedAlias(VTableName);

if (!VTable)
#ifdef INTEL_SYCL_OPAQUEPOINTER_READY
VTable = CGM.getModule().getOrInsertGlobal(VTableName, CGM.Int8PtrTy);
#else // INTEL_SYCL_OPAQUEPOINTER_READY
VTable = CGM.CreateRuntimeVariable(CGM.DefaultInt8PtrTy, VTableName);
#endif // INTEL_SYCL_OPAQUEPOINTER_READY

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

Expand All @@ -3897,18 +3893,12 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
llvm::ConstantExpr::getInBoundsGetElementPtr(CGM.Int8Ty, VTable, Eight);
} else {
llvm::Constant *Two = llvm::ConstantInt::get(PtrDiffTy, 2);
#ifdef INTEL_SYCL_OPAQUEPOINTER_READY
VTable = llvm::ConstantExpr::getInBoundsGetElementPtr(CGM.Int8PtrTy,
#else // INTEL_SYCL_OPAQUEPOINTER_READY
VTable = llvm::ConstantExpr::getInBoundsGetElementPtr(CGM.DefaultInt8PtrTy,
#endif // INTEL_SYCL_OPAQUEPOINTER_READY
VTable, Two);
}
#ifdef INTEL_SYCL_OPAQUEPOINTER_READY
VTable = llvm::ConstantExpr::getBitCast(VTable, CGM.GlobalsInt8PtrTy);
#else // INTEL_SYCL_OPAQUEPOINTER_READY
#ifndef INTEL_SYCL_OPAQUEPOINTER_READY
VTable = llvm::ConstantExpr::getBitCast(VTable, CGM.DefaultInt8PtrTy);
#endif // INTEL_SYCL_OPAQUEPOINTER_READY
#endif

Fields.push_back(VTable);
}
Expand Down