Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/ItaniumCXXABI.cpp
Show First 20 Lines • Show All 1,700 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool ItaniumCXXABI::canSpeculativelyEmitVTable(const CXXRecordDecl *RD) const { | bool ItaniumCXXABI::canSpeculativelyEmitVTable(const CXXRecordDecl *RD) const { | ||||
// We don't emit available_externally vtables if we are in -fapple-kext mode | // We don't emit available_externally vtables if we are in -fapple-kext mode | ||||
// because kext mode does not permit devirtualization. | // because kext mode does not permit devirtualization. | ||||
if (CGM.getLangOpts().AppleKext) | if (CGM.getLangOpts().AppleKext) | ||||
return false; | return false; | ||||
// If we don't have any not emitted inline virtual function, and if vtable is | // If vtable is hidden then it is not safe to emit available_externally | ||||
// not hidden, then we are safe to emit available_externally copy of vtable. | // copy of vtable. | ||||
if (isVTableHidden(RD)) | |||||
return false; | |||||
if (CGM.getCodeGenOpts().ForceEmitVTables) | |||||
return true; | |||||
// If we don't have any not emitted inline virtual function then we are safe | |||||
// to emit available_externally copy of vtable. | |||||
// FIXME we can still emit a copy of the vtable if we | // FIXME we can still emit a copy of the vtable if we | ||||
// can emit definition of the inline functions. | // can emit definition of the inline functions. | ||||
return !hasAnyUnusedVirtualInlineFunction(RD) && !isVTableHidden(RD); | return !hasAnyUnusedVirtualInlineFunction(RD); | ||||
} | } | ||||
static llvm::Value *performTypeAdjustment(CodeGenFunction &CGF, | static llvm::Value *performTypeAdjustment(CodeGenFunction &CGF, | ||||
Address InitialPtr, | Address InitialPtr, | ||||
int64_t NonVirtualAdjustment, | int64_t NonVirtualAdjustment, | ||||
int64_t VirtualAdjustment, | int64_t VirtualAdjustment, | ||||
bool IsReturnAdjustment) { | bool IsReturnAdjustment) { | ||||
if (!NonVirtualAdjustment && !VirtualAdjustment) | if (!NonVirtualAdjustment && !VirtualAdjustment) | ||||
return InitialPtr.getPointer(); | return InitialPtr.getPointer(); | ||||
▲ Show 20 Lines • Show All 2,380 Lines • Show Last 20 Lines |