• Home
  • Raw
  • Download

Lines Matching refs:CGM

32 CodeGenVTables::CodeGenVTables(CodeGenModule &CGM)  in CodeGenVTables()  argument
33 : CGM(CGM), VTContext(CGM.getContext().getVTableContext()) {} in CodeGenVTables()
53 static void setThunkVisibility(CodeGenModule &CGM, const CXXMethodDecl *MD, in setThunkVisibility() argument
55 CGM.setGlobalVisibility(Fn, MD); in setThunkVisibility()
58 static void setThunkProperties(CodeGenModule &CGM, const ThunkInfo &Thunk, in setThunkProperties() argument
61 CGM.setFunctionLinkage(GD, ThunkFn); in setThunkProperties()
62 CGM.getCXXABI().setThunkLinkage(ThunkFn, ForVTable, GD, in setThunkProperties()
67 setThunkVisibility(CGM, MD, Thunk, ThunkFn); in setThunkProperties()
69 if (CGM.supportsCOMDAT() && ThunkFn->isWeakForLinker()) in setThunkProperties()
70 ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName())); in setThunkProperties()
106 auto ClassAlign = CGF.CGM.getClassPointerAlignment(ClassDecl); in PerformReturnAdjustment()
107 ReturnValue = CGF.CGM.getCXXABI().performReturnAdjustment(CGF, in PerformReturnAdjustment()
153 llvm::Type *Ty = CGM.getTypes().GetFunctionType(FnInfo); in GenerateVarArgsThunk()
154 llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty, /*ForVTable=*/true); in GenerateVarArgsThunk()
170 if (CGM.ReturnTypeUsesSRet(FnInfo)) in GenerateVarArgsThunk()
175 Address ThisPtr(&*AI, CGM.getClassPointerAlignment(MD->getParent())); in GenerateVarArgsThunk()
187 CGM.getCXXABI().performThisAdjustment(*this, ThisPtr, Thunk.This); in GenerateVarArgsThunk()
218 QualType ResultType = CGM.getCXXABI().HasThisReturn(GD) in StartThunk()
220 : CGM.getCXXABI().hasMostDerivedReturn(GD) in StartThunk()
221 ? CGM.getContext().VoidPtrTy in StartThunk()
226 CGM.getCXXABI().buildThisParam(*this, FunctionArgs); in StartThunk()
232 CGM.getCXXABI().addImplicitStructorParams(*this, ResultType, FunctionArgs); in StartThunk()
239 CGM.getCXXABI().EmitInstanceFunctionProlog(*this); in StartThunk()
262 Thunk ? CGM.getCXXABI().performThisAdjustment( in EmitCallAndReturnForThunk()
271 CGM.ErrorUnsupported( in EmitCallAndReturnForThunk()
284 CGM.getCXXABI().adjustCallArgsForDestructorThunk(*this, CurGD, CallArgs); in EmitCallAndReturnForThunk()
293 const CGFunctionInfo &CallFnInfo = CGM.getTypes().arrangeCXXMethodCall( in EmitCallAndReturnForThunk()
310 QualType ResultType = CGM.getCXXABI().HasThisReturn(CurGD) in EmitCallAndReturnForThunk()
312 : CGM.getCXXABI().hasMostDerivedReturn(CurGD) in EmitCallAndReturnForThunk()
313 ? CGM.getContext().VoidPtrTy in EmitCallAndReturnForThunk()
333 CGM.getCXXABI().EmitReturnFromThunk(*this, RV, ResultType); in EmitCallAndReturnForThunk()
378 CGM.ConstructAttributeList(Callee->getName(), *CurFnInfo, MD, AttributeList, in EmitMustTailThunk()
403 CGM.getTypes().GetFunctionType(CGM.getTypes().arrangeGlobalDeclaration(GD)); in generateThunk()
404 llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty, /*ForVTable=*/true); in generateThunk()
412 const CGFunctionInfo &FnInfo = CGM.getTypes().arrangeGlobalDeclaration(GD); in emitThunk()
415 llvm::Constant *C = CGM.GetAddrOfThunk(GD, Thunk); in emitThunk()
429 CGM.getTypes().GetFunctionTypeForVTable(GD)) { in emitThunk()
438 Entry = cast<llvm::GlobalValue>(CGM.GetAddrOfThunk(GD, Thunk)); in emitThunk()
452 bool ABIHasKeyFunctions = CGM.getTarget().getCXXABI().hasKeyFunctions(); in emitThunk()
461 setThunkProperties(CGM, Thunk, ThunkFn, ForVTable, GD); in emitThunk()
465 CGM.SetLLVMFunctionAttributesForDefinition(GD.getDecl(), ThunkFn); in emitThunk()
476 CodeGenFunction(CGM).GenerateVarArgsThunk(ThunkFn, FnInfo, GD, Thunk); in emitThunk()
479 CodeGenFunction(CGM).generateThunk(ThunkFn, FnInfo, GD, Thunk); in emitThunk()
482 setThunkProperties(CGM, Thunk, ThunkFn, ForVTable, GD); in emitThunk()
491 if (CGM.getTarget().getCXXABI().hasKeyFunctions() && in maybeEmitThunkForVTable()
492 !CGM.getCodeGenOpts().OptimizationLevel) in maybeEmitThunkForVTable()
497 if (!CGM.getTypes().isFuncTypeConvertible( in maybeEmitThunkForVTable()
529 llvm::Type *Int8PtrTy = CGM.Int8PtrTy; in CreateVTableInitializer()
532 CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType()); in CreateVTableInitializer()
582 if (CGM.getLangOpts().CUDA) { in CreateVTableInitializer()
589 bool CanEmitMethod = CGM.getLangOpts().CUDAIsDevice in CreateVTableInitializer()
604 llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false); in CreateVTableInitializer()
605 StringRef PureCallName = CGM.getCXXABI().GetPureVirtualCallName(); in CreateVTableInitializer()
606 PureVirtualFn = CGM.CreateRuntimeFunction(Ty, PureCallName); in CreateVTableInitializer()
610 CGM.Int8PtrTy); in CreateVTableInitializer()
616 llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false); in CreateVTableInitializer()
618 CGM.getCXXABI().GetDeletedVirtualCallName(); in CreateVTableInitializer()
619 DeletedVirtualFn = CGM.CreateRuntimeFunction(Ty, DeletedCallName); in CreateVTableInitializer()
623 CGM.Int8PtrTy); in CreateVTableInitializer()
633 Init = CGM.GetAddrOfThunk(GD, Thunk); in CreateVTableInitializer()
637 llvm::Type *Ty = CGM.getTypes().GetFunctionTypeForVTable(GD); in CreateVTableInitializer()
639 Init = CGM.GetAddrOfFunction(GD, Ty, /*ForVTable=*/true); in CreateVTableInitializer()
665 if (CGDebugInfo *DI = CGM.getModuleDebugInfo()) in GenerateConstructionVTable()
678 cast<ItaniumMangleContext>(CGM.getCXXABI().getMangleContext()) in GenerateConstructionVTable()
684 llvm::ArrayType::get(CGM.Int8PtrTy, VTLayout->getNumVTableComponents()); in GenerateConstructionVTable()
696 CGM.CreateOrReplaceCXXRuntimeVariable(Name, ArrayType, Linkage); in GenerateConstructionVTable()
697 CGM.setGlobalVisibility(VTable, RD); in GenerateConstructionVTable()
702 llvm::Constant *RTTI = CGM.GetAddrOfRTTIDescriptor( in GenerateConstructionVTable()
703 CGM.getContext().getTagDeclType(Base.getBase())); in GenerateConstructionVTable()
712 CGM.EmitVTableTypeMetadata(VTable, *VTLayout.get()); in GenerateConstructionVTable()
717 static bool shouldEmitAvailableExternallyVTable(const CodeGenModule &CGM, in shouldEmitAvailableExternallyVTable() argument
719 return CGM.getCodeGenOpts().OptimizationLevel > 0 && in shouldEmitAvailableExternallyVTable()
720 CGM.getCXXABI().canSpeculativelyEmitVTable(RD); in shouldEmitAvailableExternallyVTable()
824 if (CGDebugInfo *DI = CGM.getModuleDebugInfo()) in GenerateClassData()
828 CGM.getCXXABI().emitVirtualInheritanceTables(RD); in GenerateClassData()
830 CGM.getCXXABI().emitVTableDefinitions(*this, RD); in GenerateClassData()
848 if (CGM.getTarget().getCXXABI().isMicrosoft()) in isVTableExternal()
865 const CXXMethodDecl *keyFunction = CGM.getContext().getCurrentKeyFunction(RD); in isVTableExternal()
877 static bool shouldEmitVTableAtEndOfTranslationUnit(CodeGenModule &CGM, in shouldEmitVTableAtEndOfTranslationUnit() argument
880 if (!CGM.getVTables().isVTableExternal(RD)) in shouldEmitVTableAtEndOfTranslationUnit()
884 return shouldEmitAvailableExternallyVTable(CGM, RD); in shouldEmitVTableAtEndOfTranslationUnit()