Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGClass.cpp
Show First 20 Lines • Show All 2,635 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, | void CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, | ||||
llvm::Value *VTable, | llvm::Value *VTable, | ||||
SourceLocation Loc) { | SourceLocation Loc) { | ||||
if (SanOpts.has(SanitizerKind::CFIVCall)) | if (SanOpts.has(SanitizerKind::CFIVCall)) | ||||
EmitVTablePtrCheckForCall(RD, VTable, CodeGenFunction::CFITCK_VCall, Loc); | EmitVTablePtrCheckForCall(RD, VTable, CodeGenFunction::CFITCK_VCall, Loc); | ||||
else if (CGM.getCodeGenOpts().WholeProgramVTables && | else if (CGM.getCodeGenOpts().WholeProgramVTables && | ||||
CGM.HasHiddenLTOVisibility(RD)) { | // Don't insert type test assumes if we are forcing public std | ||||
// visibility. | |||||
!CGM.HasLTOVisibilityPublicStd(RD)) { | |||||
llvm::Metadata *MD = | llvm::Metadata *MD = | ||||
CGM.CreateMetadataIdentifierForType(QualType(RD->getTypeForDecl(), 0)); | CGM.CreateMetadataIdentifierForType(QualType(RD->getTypeForDecl(), 0)); | ||||
llvm::Value *TypeId = | llvm::Value *TypeId = | ||||
llvm::MetadataAsValue::get(CGM.getLLVMContext(), MD); | llvm::MetadataAsValue::get(CGM.getLLVMContext(), MD); | ||||
llvm::Value *CastedVTable = Builder.CreateBitCast(VTable, Int8PtrTy); | llvm::Value *CastedVTable = Builder.CreateBitCast(VTable, Int8PtrTy); | ||||
llvm::Value *TypeTest = | llvm::Value *TypeTest = | ||||
Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::type_test), | Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::type_test), | ||||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |