Lines Matching refs:CGM

33 static llvm::FunctionCallee getFreeExceptionFn(CodeGenModule &CGM) {  in getFreeExceptionFn()  argument
37 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false); in getFreeExceptionFn()
39 return CGM.CreateRuntimeFunction(FTy, "__cxa_free_exception"); in getFreeExceptionFn()
42 static llvm::FunctionCallee getSehTryBeginFn(CodeGenModule &CGM) { in getSehTryBeginFn() argument
44 llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false); in getSehTryBeginFn()
45 return CGM.CreateRuntimeFunction(FTy, "llvm.seh.try.begin"); in getSehTryBeginFn()
48 static llvm::FunctionCallee getSehTryEndFn(CodeGenModule &CGM) { in getSehTryEndFn() argument
50 llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false); in getSehTryEndFn()
51 return CGM.CreateRuntimeFunction(FTy, "llvm.seh.try.end"); in getSehTryEndFn()
54 static llvm::FunctionCallee getUnexpectedFn(CodeGenModule &CGM) { in getUnexpectedFn() argument
58 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false); in getUnexpectedFn()
60 return CGM.CreateRuntimeFunction(FTy, "__cxa_call_unexpected"); in getUnexpectedFn()
89 static llvm::FunctionCallee getCatchallRethrowFn(CodeGenModule &CGM, in getCatchallRethrowFn() argument
92 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false); in getCatchallRethrowFn()
94 return CGM.CreateRuntimeFunction(FTy, Name); in getCatchallRethrowFn()
230 const EHPersonality &EHPersonality::get(CodeGenModule &CGM, in get() argument
232 const llvm::Triple &T = CGM.getTarget().getTriple(); in get()
233 const LangOptions &L = CGM.getLangOpts(); in get()
234 const TargetInfo &Target = CGM.getTarget(); in get()
253 return get(CGF.CGM, dyn_cast_or_null<FunctionDecl>(FD)); in get()
256 static llvm::FunctionCallee getPersonalityFn(CodeGenModule &CGM, in getPersonalityFn() argument
258 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty, true), in getPersonalityFn()
263 static llvm::Constant *getOpaquePersonalityFn(CodeGenModule &CGM, in getOpaquePersonalityFn() argument
265 llvm::FunctionCallee Fn = getPersonalityFn(CGM, Personality); in getOpaquePersonalityFn()
267 llvm::Type::getInt8Ty(CGM.getLLVMContext()), in getOpaquePersonalityFn()
268 CGM.getDataLayout().getProgramAddressSpace()); in getOpaquePersonalityFn()
386 CGF.EmitNounwindRuntimeCall(getFreeExceptionFn(CGF.CGM), exn); in Emit()
448 CGM.getObjCRuntime().EmitThrowStmt(*this, S, false); in EmitCXXThrowExpr()
450 CGM.getCXXABI().emitThrow(*this, E); in EmitCXXThrowExpr()
453 CGM.getCXXABI().emitRethrow(*this, /*isNoReturn=*/true); in EmitCXXThrowExpr()
463 if (!CGM.getLangOpts().CXXExceptions) in EmitStartEHSpec()
492 if (CGM.getLangOpts().hasWasmExceptions()) { in EmitStartEHSpec()
496 CGM.getDiags().Report(D->getLocation(), in EmitStartEHSpec()
507 CGM.getLangOpts().getExceptionHandling() == in EmitStartEHSpec()
510 CGM.getDiags().Report(D->getLocation(), in EmitStartEHSpec()
520 llvm::Value *EHType = CGM.GetAddrOfRTTIDescriptor(ExceptType, in EmitStartEHSpec()
560 CGF.EmitRuntimeCall(getUnexpectedFn(CGF.CGM), exn) in emitFilterDispatchBlock()
566 if (!CGM.getLangOpts().CXXExceptions) in EmitEndEHSpec()
594 if (CGM.getLangOpts().hasWasmExceptions()) { in EmitEndEHSpec()
627 QualType CaughtType = CGM.getContext().getUnqualifiedArrayType( in EnterCXXTryStmt()
632 TypeInfo.RTTI = CGM.getObjCRuntime().GetEHType(CaughtType); in EnterCXXTryStmt()
634 TypeInfo = CGM.getCXXABI().getAddrOfCXXCatchHandlerType( in EnterCXXTryStmt()
639 CatchScope->setHandler(I, CGM.getCXXABI().getCatchAllTypeInfo(), Handler); in EnterCXXTryStmt()
643 EmitRuntimeCallOrInvoke(getSehTryBeginFn(CGM)); in EnterCXXTryStmt()
759 const LangOptions &LO = CGM.getLangOpts(); in getInvokeDestImpl()
779 CurFn->setPersonalityFn(getOpaquePersonalityFn(CGM, Personality)); in getInvokeDestImpl()
803 assert(!CGM.getLangOpts().IgnoreExceptions && in EmitLandingPad()
1024 CGF.CGM.getIntrinsic(llvm::Intrinsic::wasm_get_exception); in emitWasmCatchPadBlock()
1026 CGF.CGM.getIntrinsic(llvm::Intrinsic::wasm_get_ehselector); in emitWasmCatchPadBlock()
1031 llvm::Function *TypeIDFn = CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for); in emitWasmCatchPadBlock()
1116 CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for); in emitCatchDispatchBlock()
1256 CGM.getCXXABI().emitBeginCatch(*this, C); in ExitCXXTryStmt()
1274 CGM.getCXXABI().emitRethrow(*this, /*isNoReturn*/false); in ExitCXXTryStmt()
1306 CGM.getIntrinsic(llvm::Intrinsic::wasm_rethrow); in ExitCXXTryStmt()
1518 CurFn->setPersonalityFn(getOpaquePersonalityFn(CGM, Personality)); in getTerminateLandingPad()
1528 CGM.getCXXABI().emitTerminateForUnexpectedException(*this, Exn); in getTerminateLandingPad()
1552 CGM.getCXXABI().emitTerminateForUnexpectedException(*this, Exn); in getTerminateHandler()
1583 ParentPad = llvm::ConstantTokenNone::get(CGM.getLLVMContext()); in getTerminateFunclet()
1588 CGM.getCXXABI().emitTerminateForUnexpectedException(*this, nullptr); in getTerminateFunclet()
1613 EmitRuntimeCall(getCatchallRethrowFn(CGM, RethrowName), in getEHResumeBlock()
1644 EmitRuntimeCallOrInvoke(getSehTryBeginFn(CGM)); in EmitSEHTryStmt()
1704 CodeGenModule &CGM = CGF.CGM; in Emit() local
1716 CGM.getIntrinsic(llvm::Intrinsic::localaddress); in Emit()
1731 llvm::Value *Zero = llvm::Constant::getNullValue(CGM.Int32Ty); in Emit()
1740 CGM.getTypes().arrangeBuiltinFunctionCall(Context.VoidTy, Args); in Emit()
1818 &CGM.getModule(), llvm::Intrinsic::localrecover); in recoverAddrOfEscapedLocal()
1855 CGM.getTarget().getTriple().getArch() != llvm::Triple::x86) { in EmitCapturedLocals()
1862 CGBuilderTy Builder(CGM, AllocaInsertPt); in EmitCapturedLocals()
1863 if (IsFilter && CGM.getTarget().getTriple().getArch() == llvm::Triple::x86) { in EmitCapturedLocals()
1868 CGM.getIntrinsic(llvm::Intrinsic::frameaddress, AllocaInt8PtrTy), in EmitCapturedLocals()
1884 CGM.getIntrinsic(llvm::Intrinsic::eh_recoverfp); in EmitCapturedLocals()
1921 &CGM.getModule(), llvm::Intrinsic::localrecover); in EmitCapturedLocals()
1927 ParentFP = Builder.CreateBitCast(ParentFP, CGM.VoidPtrPtrTy); in EmitCapturedLocals()
1935 CGM.ErrorUnsupported(VD, "VLA captured by SEH"); in EmitCapturedLocals()
2003 MangleContext &Mangler = CGM.getCXXABI().getMangleContext(); in startOutlinedSEHHelper()
2011 if (CGM.getTarget().getTriple().getArch() != llvm::Triple::x86 || !IsFilter) { in startOutlinedSEHHelper()
2034 CGM.getTypes().arrangeBuiltinFunctionDeclaration(RetTy, Args); in startOutlinedSEHHelper()
2036 llvm::FunctionType *FnTy = CGM.getTypes().GetFunctionType(FnInfo); in startOutlinedSEHHelper()
2038 FnTy, llvm::GlobalValue::InternalLinkage, Name.str(), &CGM.getModule()); in startOutlinedSEHHelper()
2046 CGM.SetInternalFunctionAttributes(GlobalDecl(), CurFn, FnInfo); in startOutlinedSEHHelper()
2089 if (CGM.getTarget().getTriple().getArch() != llvm::Triple::x86) { in EmitSEHExceptionCodeSave()
2113 llvm::Type *RecordTy = CGM.Int32Ty->getPointerTo(); in EmitSEHExceptionCodeSave()
2114 llvm::Type *PtrsTy = llvm::StructType::get(RecordTy, CGM.VoidPtrTy); in EmitSEHExceptionCodeSave()
2150 CodeGenFunction HelperCGF(CGM, /*suppressNewContext=*/true); in EnterSEHTryStmt()
2175 if (CGM.getTarget().getTriple().getArch() != llvm::Triple::x86 && C && in EnterSEHTryStmt()
2199 llvm::FunctionCallee SehTryEnd = getSehTryEndFn(CGM); in ExitSEHTryStmt()
2243 if (CGM.getTarget().getTriple().getArch() != llvm::Triple::x86) { in ExitSEHTryStmt()
2245 CGM.getIntrinsic(llvm::Intrinsic::eh_exceptioncode); in ExitSEHTryStmt()