Lines Matching refs:CGM
47 MicrosoftCXXABI(CodeGenModule &CGM) in MicrosoftCXXABI() argument
48 : CGCXXABI(CGM), BaseClassDescriptorType(nullptr), in MicrosoftCXXABI()
52 assert(!(CGM.getLangOpts().isExplicitDefaultVisibilityExportMapping() || in MicrosoftCXXABI()
53 CGM.getLangOpts().isAllDefaultVisibilityExportMapping()) && in MicrosoftCXXABI()
266 CGM.getMicrosoftVTableContext().getMethodVFTableLocation(LookupGD); in getThisArgumentTypeForMethod()
364 if (auto *VDispMap = CGM.getModule().getNamedGlobal(MangledName)) in getAddrOfVirtualDisplacementMap()
367 MicrosoftVTableContext &VTContext = CGM.getMicrosoftVTableContext(); in getAddrOfVirtualDisplacementMap()
370 llvm::UndefValue::get(CGM.IntTy)); in getAddrOfVirtualDisplacementMap()
371 Map[0] = llvm::ConstantInt::get(CGM.IntTy, 0); in getAddrOfVirtualDisplacementMap()
380 Map[SrcVBIndex] = llvm::ConstantInt::get(CGM.IntTy, DstVBIndex * 4); in getAddrOfVirtualDisplacementMap()
387 llvm::ArrayType *VDispMapTy = llvm::ArrayType::get(CGM.IntTy, Map.size()); in getAddrOfVirtualDisplacementMap()
394 CGM.getModule(), VDispMapTy, /*isConstant=*/true, Linkage, in getAddrOfVirtualDisplacementMap()
426 CodeGenModule &CGM, ArrayRef<const VarDecl *> CXXThreadLocals,
484 return CGM.getTarget().getPointerWidth(LangAS::Default) == 64; in isImageRelative()
496 CGM.Int8PtrPtrTy, in getTypeDescriptorType()
497 CGM.Int8PtrTy, in getTypeDescriptorType()
498 llvm::ArrayType::get(CGM.Int8Ty, TypeInfoString.size() + 1)}; in getTypeDescriptorType()
500 llvm::StructType::create(CGM.getLLVMContext(), FieldTypes, TDTypeName); in getTypeDescriptorType()
507 return CGM.IntTy; in getImageRelativeType()
514 getImageRelativeType(CGM.Int8PtrTy), in getBaseClassDescriptorType()
515 CGM.IntTy, in getBaseClassDescriptorType()
516 CGM.IntTy, in getBaseClassDescriptorType()
517 CGM.IntTy, in getBaseClassDescriptorType()
518 CGM.IntTy, in getBaseClassDescriptorType()
519 CGM.IntTy, in getBaseClassDescriptorType()
523 CGM.getLLVMContext(), FieldTypes, "rtti.BaseClassDescriptor"); in getBaseClassDescriptorType()
532 CGM.getLLVMContext(), "rtti.ClassHierarchyDescriptor"); in getClassHierarchyDescriptorType()
534 CGM.IntTy, in getClassHierarchyDescriptorType()
535 CGM.IntTy, in getClassHierarchyDescriptorType()
536 CGM.IntTy, in getClassHierarchyDescriptorType()
548 CGM.getLLVMContext(), "rtti.CompleteObjectLocator"); in getCompleteObjectLocatorType()
550 CGM.IntTy, in getCompleteObjectLocatorType()
551 CGM.IntTy, in getCompleteObjectLocatorType()
552 CGM.IntTy, in getCompleteObjectLocatorType()
553 getImageRelativeType(CGM.Int8PtrTy), in getCompleteObjectLocatorType()
566 if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(Name)) in getImageBase()
569 auto *GV = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8Ty, in getImageBase()
573 CGM.setDSOLocal(GV); in getImageBase()
582 return llvm::Constant::getNullValue(CGM.IntTy); in getImageRelativeConstant()
585 llvm::ConstantExpr::getPtrToInt(getImageBase(), CGM.IntPtrTy); in getImageRelativeConstant()
587 llvm::ConstantExpr::getPtrToInt(PtrVal, CGM.IntPtrTy); in getImageRelativeConstant()
591 return llvm::ConstantExpr::getTrunc(Diff, CGM.IntTy); in getImageRelativeConstant()
600 return llvm::ConstantInt::get(CGM.IntTy, 0); in getZeroInt()
604 return llvm::Constant::getAllOnesValue(CGM.IntTy); in getAllOnesInt()
628 llvm::Value *VBPOffset = llvm::ConstantInt::get(CGM.IntTy, VBPtrOffset), in GetVBaseOffsetFromVBPtr()
629 *VBTOffset = llvm::ConstantInt::get(CGM.IntTy, VBTableOffset); in GetVBaseOffsetFromVBPtr()
730 CGM.IntTy, // Flags in getCatchableTypeType()
731 getImageRelativeType(CGM.Int8PtrTy), // TypeDescriptor in getCatchableTypeType()
732 CGM.IntTy, // NonVirtualAdjustment in getCatchableTypeType()
733 CGM.IntTy, // OffsetToVBPtr in getCatchableTypeType()
734 CGM.IntTy, // VBTableIndex in getCatchableTypeType()
735 CGM.IntTy, // Size in getCatchableTypeType()
736 getImageRelativeType(CGM.Int8PtrTy) // CopyCtor in getCatchableTypeType()
739 CGM.getLLVMContext(), FieldTypes, "eh.CatchableType"); in getCatchableTypeType()
754 CGM.IntTy, // NumEntries in getCatchableTypeArrayType()
758 llvm::StructType::create(CGM.getLLVMContext(), FieldTypes, CTATypeName); in getCatchableTypeArrayType()
766 CGM.IntTy, // Flags in getThrowInfoType()
767 getImageRelativeType(CGM.Int8PtrTy), // CleanupFn in getThrowInfoType()
768 getImageRelativeType(CGM.Int8PtrTy), // ForwardCompat in getThrowInfoType()
769 getImageRelativeType(CGM.Int8PtrTy) // CatchableTypeArray in getThrowInfoType()
771 ThrowInfoType = llvm::StructType::create(CGM.getLLVMContext(), FieldTypes, in getThrowInfoType()
779 llvm::Type *Args[] = {CGM.Int8PtrTy, getThrowInfoType()->getPointerTo()}; in getThrowFn()
781 llvm::FunctionType::get(CGM.VoidTy, Args, /*isVarArg=*/false); in getThrowFn()
783 CGM.CreateRuntimeFunction(FTy, "_CxxThrowException"); in getThrowFn()
785 if (CGM.getTarget().getTriple().getArch() == llvm::Triple::x86) { in getThrowFn()
862 switch (CGM.getTarget().getTriple().getArch()) { in getRecordArgABI()
911 llvm::ConstantPointerNull::get(CGM.Int8PtrTy), in emitRethrow()
977 CGF.CGM.getVBaseAlignment(Value.getAlignment(), SrcDecl, PolymorphicBase); in performBaseAdjustment()
993 llvm::FunctionCallee Fn = CGF.CGM.CreateRuntimeFunction(FTy, "__RTtypeid"); in emitRTtypeidCall()
999 emitRTtypeidCall(CGF, llvm::Constant::getNullValue(CGM.VoidPtrTy)); in EmitBadTypeidCall()
1025 CGF.CGM.GetAddrOfRTTIDescriptor(SrcRecordTy.getUnqualifiedType()); in emitDynamicCastCall()
1027 CGF.CGM.GetAddrOfRTTIDescriptor(DestRecordTy.getUnqualifiedType()); in emitDynamicCastCall()
1043 llvm::FunctionCallee Function = CGF.CGM.CreateRuntimeFunction( in emitDynamicCastCall()
1061 llvm::FunctionCallee Function = CGF.CGM.CreateRuntimeFunction( in emitDynamicCastToVoid()
1078 llvm::Value *VBPtrOffset = llvm::ConstantInt::get(CGM.PtrDiffTy, VBPtrChars); in GetVirtualBaseClassOffset()
1082 CGM.getMicrosoftVTableContext().getVBTableIndex(ClassDecl, BaseClassDecl); in GetVirtualBaseClassOffset()
1084 llvm::ConstantInt::get(CGM.IntTy, VBTableChars.getQuantity()); in GetVirtualBaseClassOffset()
1089 CGF.Builder.CreateSExtOrBitCast(VBPtrToNewBase, CGM.PtrDiffTy); in GetVirtualBaseClassOffset()
1107 CodeGenModule &CGM) { in isTrivialForMSVC() argument
1113 if (CGM.getTarget().getTriple().isAArch64() && in isTrivialForMSVC()
1114 CGM.getABIInfo().isHomogeneousAggregate(Ty, Base, NumElts) && in isTrivialForMSVC()
1174 isTrivialForMSVC(RD, FI.getReturnType(), CGM); in classifyReturnType()
1180 CharUnits Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType()); in classifyReturnType()
1188 FI.getReturnInfo().setInReg(CGM.getTarget().getTriple().isAArch64()); in classifyReturnType()
1275 VBaseOffset, llvm::ConstantInt::get(CGM.PtrDiffTy, ConstantVBaseOffset), in initializeHiddenVirtualInheritanceMembers()
1303 CGM.EmitGlobal(GlobalDecl(D, Ctor_Complete)); in EmitCXXConstructors()
1314 CGM.setGVProperties(Fn, D); in EmitCXXConstructors()
1322 This = This.withElementType(CGM.Int8Ty); in EmitVBPtrStores()
1386 CGM.setDLLImportDLLExport(GV, ND); in setCXXDestructorDLLStorage()
1401 return CGM.getLLVMLinkageForDeclarator(Dtor, Linkage); in getCXXDestructorLinkage()
1425 CGM.EmitGlobal(GlobalDecl(D, Dtor_Base)); in EmitCXXDestructors()
1432 CGM.EmitGlobal(GlobalDecl(D, Dtor_Complete)); in EmitCXXDestructors()
1451 CGM.getMicrosoftVTableContext().getMethodVFTableLocation(GD); in getVirtualFunctionPrologueThisAdjustment()
1499 CGM.getMicrosoftVTableContext().getMethodVFTableLocation(LookupGD); in adjustThisArgumentForVirtualFunctionCall()
1520 CGF.CGM.getVBaseAlignment(Result.getAlignment(), Derived, VBase); in adjustThisArgumentForVirtualFunctionCall()
1642 MostDerivedArg = llvm::ConstantInt::get(CGM.Int32Ty, Type == Ctor_Complete); in getImplicitConstructorArgs()
1668 CGCallee Callee = CGCallee::forDirect(CGM.getAddrOfCXXStructor(GD), GD); in EmitDestructorCall()
1702 if (!CGM.getCodeGenOpts().LTOUnit && in emitVTableTypeMetadata()
1703 !CGM.getCodeGenOpts().hasProfileIRInstr()) in emitVTableTypeMetadata()
1708 if (CGM.getCodeGenOpts().WholeProgramVTables) { in emitVTableTypeMetadata()
1711 CGM.GetVCallVisibilityLevel(RD, Visited); in emitVTableTypeMetadata()
1726 CGM.AddVTableTypeMetadata(VTable, AddressPoint, RD); in emitVTableTypeMetadata()
1731 CGM.AddVTableTypeMetadata(VTable, AddressPoint, in emitVTableTypeMetadata()
1750 CGM.AddVTableTypeMetadata(VTable, AddressPoint, DerivedRD); in emitVTableTypeMetadata()
1755 CGM.AddVTableTypeMetadata(VTable, AddressPoint, RD); in emitVTableTypeMetadata()
1760 MicrosoftVTableContext &VFTContext = CGM.getMicrosoftVTableContext(); in emitVTableDefinitions()
1776 ConstantInitBuilder builder(CGM); in emitVTableDefinitions()
1832 MicrosoftVTableContext &VTContext = CGM.getMicrosoftVTableContext(); in getAddrOfVTable()
1838 CGM.addDeferredVTable(RD); in getAddrOfVTable()
1875 : CGM.getVTableLinkage(RD); in getAddrOfVTable()
1883 CGM.getModule().getNamedGlobal(VFTableName)) { in getAddrOfVTable()
1899 llvm::Type *VTableType = CGM.getVTables().getVTableType(VTLayout); in getAddrOfVTable()
1904 VTable = new llvm::GlobalVariable(CGM.getModule(), VTableType, in getAddrOfVTable()
1912 C = CGM.getModule().getOrInsertComdat(VFTableName.str()); in getAddrOfVTable()
1918 llvm::Value *GEPIndices[] = {llvm::ConstantInt::get(CGM.Int32Ty, 0), in getAddrOfVTable()
1919 llvm::ConstantInt::get(CGM.Int32Ty, 0), in getAddrOfVTable()
1920 llvm::ConstantInt::get(CGM.Int32Ty, 1)}; in getAddrOfVTable()
1930 VFTable = llvm::GlobalAlias::create(CGM.Int8PtrTy, in getAddrOfVTable()
1933 &CGM.getModule()); in getAddrOfVTable()
1967 MicrosoftVTableContext &VFTContext = CGM.getMicrosoftVTableContext(); in getVirtualFunctionPointer()
1987 CGM.getContext().getTargetInfo().getPointerWidth(LangAS::Default) / in getVirtualFunctionPointer()
1990 if (CGM.getCodeGenOpts().PrepareForLTO) in getVirtualFunctionPointer()
2015 &CGM.getTypes().arrangeCXXStructorDeclaration(GD); in EmitVirtualDestructorCall()
2016 llvm::FunctionType *Ty = CGF.CGM.getTypes().GetFunctionType(*FInfo); in EmitVirtualDestructorCall()
2050 MicrosoftVTableContext &Context = CGM.getMicrosoftVTableContext(); in enumerateVBTables()
2055 llvm::GlobalVariable::LinkageTypes Linkage = CGM.getVTableLinkage(RD); in enumerateVBTables()
2077 if (llvm::GlobalValue *GV = CGM.getModule().getNamedValue(ThunkName)) in EmitVirtualMemPtrThunk()
2082 CGM.getTypes().arrangeUnprototypedMustTailThunk(MD); in EmitVirtualMemPtrThunk()
2083 llvm::FunctionType *ThunkTy = CGM.getTypes().GetFunctionType(FnInfo); in EmitVirtualMemPtrThunk()
2086 ThunkName.str(), &CGM.getModule()); in EmitVirtualMemPtrThunk()
2093 ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName())); in EmitVirtualMemPtrThunk()
2095 CGM.SetLLVMFunctionAttributes(MD, FnInfo, ThunkFn, /*IsThunk=*/false); in EmitVirtualMemPtrThunk()
2096 CGM.SetLLVMFunctionAttributesForDefinition(MD, ThunkFn); in EmitVirtualMemPtrThunk()
2108 CodeGenFunction CGF(CGM); in EmitVirtualMemPtrThunk()
2159 llvm::ArrayType::get(CGM.IntTy, 1 + VBT.ObjectWithVPtr->getNumVBases()); in getAddrOfVBTable()
2161 assert(!CGM.getModule().getNamedGlobal(Name) && in getAddrOfVBTable()
2164 CGM.getContext().getTypeAlignInChars(CGM.getContext().IntTy); in getAddrOfVBTable()
2165 llvm::GlobalVariable *GV = CGM.CreateOrReplaceCXXRuntimeVariable( in getAddrOfVBTable()
2197 Offsets[0] = llvm::ConstantInt::get(CGM.IntTy, -VBPtrOffset.getQuantity()); in emitVBTableDefinition()
2199 MicrosoftVTableContext &Context = CGM.getMicrosoftVTableContext(); in emitVBTableDefinition()
2214 Offsets[VBIndex] = llvm::ConstantInt::get(CGM.IntTy, Offset.getQuantity()); in emitVBTableDefinition()
2220 llvm::ArrayType::get(CGM.IntTy, Offsets.size()); in emitVBTableDefinition()
2367 llvm::FunctionCallee TLRegDtor = CGF.CGM.CreateRuntimeFunction( in emitGlobalDtorWithTLRegDtor()
2379 if (D.isNoDestroy(CGM.getContext())) in registerGlobalDtor()
2386 if (CGM.getLangOpts().HLSL) in registerGlobalDtor()
2387 return CGM.AddCXXDtorEntry(Dtor, Addr); in registerGlobalDtor()
2394 CodeGenModule &CGM, ArrayRef<const VarDecl *> CXXThreadLocals, in EmitThreadLocalInitFuncs() argument
2400 CGM.AppendLinkerOptions(CGM.getTarget().getTriple().getArch() == in EmitThreadLocalInitFuncs()
2408 auto AddToXDU = [&CGM](llvm::Function *InitFunc) { in EmitThreadLocalInitFuncs()
2410 CGM.getModule(), InitFunc->getType(), /*isConstant=*/true, in EmitThreadLocalInitFuncs()
2416 CGM.addUsedGlobal(InitFuncPtr); in EmitThreadLocalInitFuncs()
2423 CGM.GetGlobalValue(CGM.getMangledName(CXXThreadLocalInitVars[I]))); in EmitThreadLocalInitFuncs()
2435 llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false); in EmitThreadLocalInitFuncs()
2436 llvm::Function *InitFunc = CGM.CreateGlobalInitOrCleanUpFunction( in EmitThreadLocalInitFuncs()
2437 FTy, "__tls_init", CGM.getTypes().arrangeNullaryFunction(), in EmitThreadLocalInitFuncs()
2439 CodeGenFunction(CGM).GenerateCXXGlobalInitFunc(InitFunc, NonComdatInits); in EmitThreadLocalInitFuncs()
2445 static llvm::GlobalValue *getTlsGuardVar(CodeGenModule &CGM) { in getTlsGuardVar() argument
2450 llvm::Type *VTy = llvm::Type::getInt8Ty(CGM.getLLVMContext()); in getTlsGuardVar()
2452 CGM.CreateRuntimeVariable(VTy, "__tls_guard"); in getTlsGuardVar()
2460 static llvm::FunctionCallee getDynTlsOnDemandInitFn(CodeGenModule &CGM) { in getDynTlsOnDemandInitFn() argument
2464 llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), {}, in getDynTlsOnDemandInitFn()
2466 return CGM.CreateRuntimeFunction( in getDynTlsOnDemandInitFn()
2468 llvm::AttributeList::get(CGM.getLLVMContext(), in getDynTlsOnDemandInitFn()
2487 llvm::FunctionCallee Initializer = getDynTlsOnDemandInitFn(CGF.CGM); in emitDynamicTlsInitializationCall()
2502 llvm::GlobalValue *TlsGuard = getTlsGuardVar(CGF.CGM); in emitDynamicTlsInitialization()
2522 llvm::Value *V = CGF.CGM.GetAddrOfGlobalVar(VD); in EmitThreadLocalVarDeclLValue()
2535 static ConstantAddress getInitThreadEpochPtr(CodeGenModule &CGM) { in getInitThreadEpochPtr() argument
2537 CharUnits Align = CGM.getIntAlign(); in getInitThreadEpochPtr()
2538 if (auto *GV = CGM.getModule().getNamedGlobal(VarName)) in getInitThreadEpochPtr()
2541 CGM.getModule(), CGM.IntTy, in getInitThreadEpochPtr()
2549 static llvm::FunctionCallee getInitThreadHeaderFn(CodeGenModule &CGM) { in getInitThreadHeaderFn() argument
2551 llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), in getInitThreadHeaderFn()
2552 CGM.IntTy->getPointerTo(), /*isVarArg=*/false); in getInitThreadHeaderFn()
2553 return CGM.CreateRuntimeFunction( in getInitThreadHeaderFn()
2555 llvm::AttributeList::get(CGM.getLLVMContext(), in getInitThreadHeaderFn()
2561 static llvm::FunctionCallee getInitThreadFooterFn(CodeGenModule &CGM) { in getInitThreadFooterFn() argument
2563 llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), in getInitThreadFooterFn()
2564 CGM.IntTy->getPointerTo(), /*isVarArg=*/false); in getInitThreadFooterFn()
2565 return CGM.CreateRuntimeFunction( in getInitThreadFooterFn()
2567 llvm::AttributeList::get(CGM.getLLVMContext(), in getInitThreadFooterFn()
2573 static llvm::FunctionCallee getInitThreadAbortFn(CodeGenModule &CGM) { in getInitThreadAbortFn() argument
2575 llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), in getInitThreadAbortFn()
2576 CGM.IntTy->getPointerTo(), /*isVarArg=*/false); in getInitThreadAbortFn()
2577 return CGM.CreateRuntimeFunction( in getInitThreadAbortFn()
2579 llvm::AttributeList::get(CGM.getLLVMContext(), in getInitThreadAbortFn()
2609 CGF.EmitNounwindRuntimeCall(getInitThreadAbortFn(CGF.CGM), Guard); in Emit()
2623 F->setComdat(CGM.getModule().getOrInsertComdat(F->getName())); in EmitGuardedInit()
2684 new llvm::GlobalVariable(CGM.getModule(), GuardTy, /*isConstant=*/false, in EmitGuardedInit()
2691 CGM.getModule().getOrInsertComdat(GuardVar->getName())); in EmitGuardedInit()
2693 CGM.setTLSMode(GuardVar, D); in EmitGuardedInit()
2748 Builder.CreateLoad(getInitThreadEpochPtr(CGM)); in EmitGuardedInit()
2759 CGF.EmitNounwindRuntimeCall(getInitThreadHeaderFn(CGM), in EmitGuardedInit()
2773 CGF.EmitNounwindRuntimeCall(getInitThreadFooterFn(CGM), in EmitGuardedInit()
2802 fields.push_back(CGM.VoidPtrTy); // FunctionPointerOrVirtualThunk in ConvertMemberPointerType()
2804 fields.push_back(CGM.IntTy); // FieldOffset in ConvertMemberPointerType()
2808 fields.push_back(CGM.IntTy); in ConvertMemberPointerType()
2810 fields.push_back(CGM.IntTy); in ConvertMemberPointerType()
2812 fields.push_back(CGM.IntTy); // VirtualBaseAdjustmentOffset in ConvertMemberPointerType()
2816 return llvm::StructType::get(CGM.getLLVMContext(), fields); in ConvertMemberPointerType()
2827 fields.push_back(llvm::Constant::getNullValue(CGM.VoidPtrTy)); in GetNullMemberPointerFields()
2873 CGM.IntTy, NonVirtualBaseAdjustment.getQuantity())); in EmitFullMemberPointer()
2879 fields.push_back(llvm::ConstantInt::get(CGM.IntTy, Offs.getQuantity())); in EmitFullMemberPointer()
2884 fields.push_back(llvm::ConstantInt::get(CGM.IntTy, VBTableIndex)); in EmitFullMemberPointer()
2901 llvm::ConstantInt::get(CGM.IntTy, offset.getQuantity()); in EmitMemberDataPointer()
2975 CodeGenTypes &Types = CGM.getTypes(); in EmitMemberFunctionPointer()
2989 Ty = CGM.PtrDiffTy; in EmitMemberFunctionPointer()
2991 FirstField = CGM.GetAddrOfFunction(MD, Ty); in EmitMemberFunctionPointer()
2993 auto &VTableContext = CGM.getMicrosoftVTableContext(); in EmitMemberFunctionPointer()
3083 fields.push_back(llvm::Constant::getNullValue(CGM.VoidPtrTy)); in EmitMemberPointerIsNotNull()
3146 CGM.Int8Ty, This.emitRawPointer(CGF), VBPtrOffset, "vbptr"); in GetVBaseOffsetFromVBPtr()
3159 CGM.Int32Ty->getPointerTo(0), VBPtr, VBPtrAlign, "vbtable"); in GetVBaseOffsetFromVBPtr()
3168 Builder.CreateInBoundsGEP(CGM.Int32Ty, VBTable, VBTableIndex); in GetVBaseOffsetFromVBPtr()
3169 return Builder.CreateAlignedLoad(CGM.Int32Ty, VBaseOffs, in GetVBaseOffsetFromVBPtr()
3179 Base = Base.withElementType(CGM.Int8Ty); in AdjustVirtualBase()
3204 DiagnosticsEngine &Diags = CGF.CGM.getDiags(); in AdjustVirtualBase()
3212 VBPtrOffset = llvm::ConstantInt::get(CGM.IntTy, offs.getQuantity()); in AdjustVirtualBase()
3218 Builder.CreateInBoundsGEP(CGM.Int8Ty, VBPtr, VBaseOffs); in AdjustVirtualBase()
3224 llvm::PHINode *Phi = Builder.CreatePHI(CGM.Int8PtrTy, 2, "memptr.base"); in AdjustVirtualBase()
3382 llvm::ConstantInt::get(CGM.IntTy, SrcOffsetToFirstVBase), in EmitNonNullMemberPointerConversion()
3396 CGM.IntTy, in EmitNonNullMemberPointerConversion()
3397 CGM.computeNonVirtualBaseClassOffset(DerivedClass, PathBegin, PathEnd) in EmitNonNullMemberPointerConversion()
3416 VirtualBaseAdjustmentOffset, llvm::ConstantInt::get(CGM.IntTy, 4)); in EmitNonNullMemberPointerConversion()
3424 CGM.IntTy, Builder.CreateInBoundsGEP(VDispMap->getValueType(), in EmitNonNullMemberPointerConversion()
3438 CGM.IntTy, in EmitNonNullMemberPointerConversion()
3452 llvm::ConstantInt::get(CGM.IntTy, DstOffsetToFirstVBase), in EmitNonNullMemberPointerConversion()
3507 CGBuilderTy Builder(CGM, CGM.getLLVMContext()); in EmitMemberPointerConversion()
3559 CGCXXABI *clang::CodeGen::CreateMicrosoftCXXABI(CodeGenModule &CGM) { in CreateMicrosoftCXXABI() argument
3560 return new MicrosoftCXXABI(CGM); in CreateMicrosoftCXXABI()
3593 static llvm::GlobalVariable *getTypeInfoVTable(CodeGenModule &CGM) { in getTypeInfoVTable() argument
3595 if (auto VTable = CGM.getModule().getNamedGlobal(MangledName)) in getTypeInfoVTable()
3597 return new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy, in getTypeInfoVTable()
3692 : CGM(ABI.CGM), Context(CGM.getContext()), in MSRTTIBuilder()
3693 VMContext(CGM.getLLVMContext()), Module(CGM.getModule()), RD(RD), in MSRTTIBuilder()
3694 Linkage(getLinkageForRTTI(CGM.getContext().getTagDeclType(RD))), in MSRTTIBuilder()
3703 CodeGenModule &CGM; member
3775 llvm::Value *GEPIndices[] = {llvm::ConstantInt::get(CGM.IntTy, 0), in getClassHierarchyDescriptor()
3776 llvm::ConstantInt::get(CGM.IntTy, 0)}; in getClassHierarchyDescriptor()
3784 CHD->setComdat(CGM.getModule().getOrInsertComdat(CHD->getName())); in getClassHierarchyDescriptor()
3790 llvm::ConstantInt::get(CGM.IntTy, 0), // reserved by the runtime in getClassHierarchyDescriptor()
3791 llvm::ConstantInt::get(CGM.IntTy, Flags), in getClassHierarchyDescriptor()
3792 llvm::ConstantInt::get(CGM.IntTy, Classes.size()), in getClassHierarchyDescriptor()
3822 BCA->setComdat(CGM.getModule().getOrInsertComdat(BCA->getName())); in getBaseClassArray()
3841 auto &VTableContext = CGM.getMicrosoftVTableContext(); in getBaseClassDescriptor()
3864 BCD->setComdat(CGM.getModule().getOrInsertComdat(BCD->getName())); in getBaseClassDescriptor()
3870 llvm::ConstantInt::get(CGM.IntTy, Class.NumBases), in getBaseClassDescriptor()
3871 llvm::ConstantInt::get(CGM.IntTy, Class.OffsetInVBase), in getBaseClassDescriptor()
3872 llvm::ConstantInt::get(CGM.IntTy, VBPtrOffset), in getBaseClassDescriptor()
3873 llvm::ConstantInt::get(CGM.IntTy, OffsetInVBTable), in getBaseClassDescriptor()
3874 llvm::ConstantInt::get(CGM.IntTy, Class.Flags), in getBaseClassDescriptor()
3912 llvm::ConstantInt::get(CGM.IntTy, ABI.isImageRelative()), in getCompleteObjectLocator()
3913 llvm::ConstantInt::get(CGM.IntTy, OffsetToTop), in getCompleteObjectLocator()
3914 llvm::ConstantInt::get(CGM.IntTy, VFPtrOffset), in getCompleteObjectLocator()
3916 CGM.GetAddrOfRTTIDescriptor(Context.getTypeDeclType(RD))), in getCompleteObjectLocator()
3925 COL->setComdat(CGM.getModule().getOrInsertComdat(COL->getName())); in getCompleteObjectLocator()
4001 if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName)) in getAddrOfRTTIDescriptor()
4016 getTypeInfoVTable(CGM), // VFPtr in getAddrOfRTTIDescriptor()
4017 llvm::ConstantPointerNull::get(CGM.Int8PtrTy), // Runtime data in getAddrOfRTTIDescriptor()
4018 llvm::ConstantDataArray::getString(CGM.getLLVMContext(), TypeInfoString)}; in getAddrOfRTTIDescriptor()
4022 CGM.getModule(), TypeDescriptorType, /*isConstant=*/false, in getAddrOfRTTIDescriptor()
4027 Var->setComdat(CGM.getModule().getOrInsertComdat(Var->getName())); in getAddrOfRTTIDescriptor()
4042 CGM.codegenCXXStructor(GD.getWithCtorType(Ctor_Complete)); in emitCXXStructor()
4043 CGM.maybeSetTrivialComdat(*ctor, *Fn); in emitCXXStructor()
4060 if (GD.getDtorType() == Dtor_Base && !CGM.TryEmitBaseDestructorAsAlias(dtor)) in emitCXXStructor()
4063 llvm::Function *Fn = CGM.codegenCXXStructor(GD); in emitCXXStructor()
4065 Fn->setComdat(CGM.getModule().getOrInsertComdat(Fn->getName())); in emitCXXStructor()
4079 if (llvm::GlobalValue *GV = CGM.getModule().getNamedValue(ThunkName)) in getAddrOfCXXCtorClosure()
4083 const CGFunctionInfo &FnInfo = CGM.getTypes().arrangeMSCtorClosure(CD, CT); in getAddrOfCXXCtorClosure()
4084 llvm::FunctionType *ThunkTy = CGM.getTypes().GetFunctionType(FnInfo); in getAddrOfCXXCtorClosure()
4088 ThunkTy, getLinkageForRTTI(RecordTy), ThunkName.str(), &CGM.getModule()); in getAddrOfCXXCtorClosure()
4092 ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName())); in getAddrOfCXXCtorClosure()
4096 CodeGenFunction CGF(CGM); in getAddrOfCXXCtorClosure()
4169 CGM.getAddrOfCXXStructor(GlobalDecl(CD, Ctor_Complete)); in getAddrOfCXXCtorClosure()
4172 const CGFunctionInfo &CalleeInfo = CGM.getTypes().arrangeCXXConstructorCall( in getAddrOfCXXCtorClosure()
4193 RD ? CGM.getContext().getCopyConstructorForExceptionObject(RD) : nullptr; in getCatchableType()
4206 if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName)) in getCatchableType()
4220 CopyCtor = CGM.getAddrOfCXXStructor(GlobalDecl(CD, Ctor_Complete)); in getCatchableType()
4222 CopyCtor = llvm::Constant::getNullValue(CGM.Int8PtrTy); in getCatchableType()
4249 llvm::ConstantInt::get(CGM.IntTy, Flags), // Flags in getCatchableType()
4251 llvm::ConstantInt::get(CGM.IntTy, NVOffset), // NonVirtualAdjustment in getCatchableType()
4252 llvm::ConstantInt::get(CGM.IntTy, VBPtrOffset), // OffsetToVBPtr in getCatchableType()
4253 llvm::ConstantInt::get(CGM.IntTy, VBIndex), // VBTableIndex in getCatchableType()
4254 llvm::ConstantInt::get(CGM.IntTy, Size), // Size in getCatchableType()
4259 CGM.getModule(), CTType, /*isConstant=*/true, getLinkageForRTTI(T), in getCatchableType()
4264 GV->setComdat(CGM.getModule().getOrInsertComdat(GV->getName())); in getCatchableType()
4301 MicrosoftVTableContext &VTableContext = CGM.getMicrosoftVTableContext(); in getCatchableTypeArray()
4366 llvm::ConstantInt::get(CGM.IntTy, NumEntries), // NumEntries in getCatchableTypeArray()
4377 CGM.getModule(), CTAType, /*isConstant=*/true, getLinkageForRTTI(T), in getCatchableTypeArray()
4382 CTA->setComdat(CGM.getModule().getOrInsertComdat(CTA->getName())); in getCatchableTypeArray()
4410 if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName)) in getThrowInfo()
4426 llvm::Constant *CleanupFn = llvm::Constant::getNullValue(CGM.Int8PtrTy); in getThrowInfo()
4430 CleanupFn = CGM.getAddrOfCXXStructor(GlobalDecl(DtorD, Dtor_Complete)); in getThrowInfo()
4433 getImageRelativeConstant(llvm::Constant::getNullValue(CGM.Int8PtrTy)); in getThrowInfo()
4437 llvm::ConstantInt::get(CGM.IntTy, Flags), // Flags in getThrowInfo()
4443 CGM.getModule(), TIType, /*isConstant=*/true, getLinkageForRTTI(T), in getThrowInfo()
4448 GV->setComdat(CGM.getModule().getOrInsertComdat(GV->getName())); in getThrowInfo()
4476 return {CGF.GetVTablePtr(This, CGM.Int8PtrTy, RD), RD}; in LoadVTablePtr()
4483 if (!CGM.getTarget().getTriple().isAArch64()) in isPermittedToBeHomogeneousAggregate()