Lines Matching refs:CGM
26 static llvm::Constant *getAllocateExceptionFn(CodeGenModule &CGM) { in getAllocateExceptionFn() argument
30 llvm::FunctionType::get(CGM.Int8PtrTy, CGM.SizeTy, /*IsVarArgs=*/false); in getAllocateExceptionFn()
32 return CGM.CreateRuntimeFunction(FTy, "__cxa_allocate_exception"); in getAllocateExceptionFn()
35 static llvm::Constant *getFreeExceptionFn(CodeGenModule &CGM) { in getFreeExceptionFn() argument
39 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false); in getFreeExceptionFn()
41 return CGM.CreateRuntimeFunction(FTy, "__cxa_free_exception"); in getFreeExceptionFn()
44 static llvm::Constant *getThrowFn(CodeGenModule &CGM) { in getThrowFn() argument
48 llvm::Type *Args[3] = { CGM.Int8PtrTy, CGM.Int8PtrTy, CGM.Int8PtrTy }; in getThrowFn()
50 llvm::FunctionType::get(CGM.VoidTy, Args, /*IsVarArgs=*/false); in getThrowFn()
52 return CGM.CreateRuntimeFunction(FTy, "__cxa_throw"); in getThrowFn()
55 static llvm::Constant *getReThrowFn(CodeGenModule &CGM) { in getReThrowFn() argument
59 llvm::FunctionType::get(CGM.VoidTy, /*IsVarArgs=*/false); in getReThrowFn()
61 return CGM.CreateRuntimeFunction(FTy, "__cxa_rethrow"); in getReThrowFn()
64 static llvm::Constant *getGetExceptionPtrFn(CodeGenModule &CGM) { in getGetExceptionPtrFn() argument
68 llvm::FunctionType::get(CGM.Int8PtrTy, CGM.Int8PtrTy, /*IsVarArgs=*/false); in getGetExceptionPtrFn()
70 return CGM.CreateRuntimeFunction(FTy, "__cxa_get_exception_ptr"); in getGetExceptionPtrFn()
73 static llvm::Constant *getBeginCatchFn(CodeGenModule &CGM) { in getBeginCatchFn() argument
77 llvm::FunctionType::get(CGM.Int8PtrTy, CGM.Int8PtrTy, /*IsVarArgs=*/false); in getBeginCatchFn()
79 return CGM.CreateRuntimeFunction(FTy, "__cxa_begin_catch"); in getBeginCatchFn()
82 static llvm::Constant *getEndCatchFn(CodeGenModule &CGM) { in getEndCatchFn() argument
86 llvm::FunctionType::get(CGM.VoidTy, /*IsVarArgs=*/false); in getEndCatchFn()
88 return CGM.CreateRuntimeFunction(FTy, "__cxa_end_catch"); in getEndCatchFn()
91 static llvm::Constant *getUnexpectedFn(CodeGenModule &CGM) { in getUnexpectedFn() argument
95 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false); in getUnexpectedFn()
97 return CGM.CreateRuntimeFunction(FTy, "__cxa_call_unexpected"); in getUnexpectedFn()
100 static llvm::Constant *getTerminateFn(CodeGenModule &CGM) { in getTerminateFn() argument
104 llvm::FunctionType::get(CGM.VoidTy, /*IsVarArgs=*/false); in getTerminateFn()
109 if (CGM.getLangOpts().CPlusPlus) in getTerminateFn()
111 else if (CGM.getLangOpts().ObjC1 && in getTerminateFn()
112 CGM.getLangOpts().ObjCRuntime.hasTerminate()) in getTerminateFn()
116 return CGM.CreateRuntimeFunction(FTy, name); in getTerminateFn()
119 static llvm::Constant *getCatchallRethrowFn(CodeGenModule &CGM, in getCatchallRethrowFn() argument
122 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false); in getCatchallRethrowFn()
124 return CGM.CreateRuntimeFunction(FTy, Name); in getCatchallRethrowFn()
234 static llvm::Constant *getPersonalityFn(CodeGenModule &CGM, in getPersonalityFn() argument
237 CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty, true), in getPersonalityFn()
242 static llvm::Constant *getOpaquePersonalityFn(CodeGenModule &CGM, in getOpaquePersonalityFn() argument
244 llvm::Constant *Fn = getPersonalityFn(CGM, Personality); in getOpaquePersonalityFn()
245 return llvm::ConstantExpr::getBitCast(Fn, CGM.Int8PtrTy); in getOpaquePersonalityFn()
349 CGF.EmitNounwindRuntimeCall(getFreeExceptionFn(CGF.CGM), exn); in Emit()
406 if (CGM.getTarget().getTriple().isWindowsMSVCEnvironment()) { in EmitCXXThrowExpr()
412 EmitNoreturnRuntimeCallOrInvoke(getReThrowFn(CGM), in EmitCXXThrowExpr()
429 CGM.getObjCRuntime().EmitThrowStmt(*this, S, false); in EmitCXXThrowExpr()
441 llvm::Constant *AllocExceptionFn = getAllocateExceptionFn(CGM); in EmitCXXThrowExpr()
450 llvm::Constant *TypeInfo = CGM.GetAddrOfRTTIDescriptor(ThrowType, in EmitCXXThrowExpr()
460 Dtor = CGM.GetAddrOfCXXDestructor(DtorD, Dtor_Complete); in EmitCXXThrowExpr()
467 EmitNoreturnRuntimeCallOrInvoke(getThrowFn(CGM), args); in EmitCXXThrowExpr()
476 if (!CGM.getLangOpts().CXXExceptions) in EmitStartEHSpec()
505 llvm::Value *EHType = CGM.GetAddrOfRTTIDescriptor(ExceptType, in EmitStartEHSpec()
544 CGF.EmitRuntimeCall(getUnexpectedFn(CGF.CGM), exn) in emitFilterDispatchBlock()
550 if (!CGM.getLangOpts().CXXExceptions) in EmitEndEHSpec()
579 if (CGM.getTarget().getTriple().isWindowsMSVCEnvironment()) { in EmitCXXTryStmt()
609 TypeInfo = CGM.getObjCRuntime().GetEHType(CaughtType); in EnterCXXTryStmt()
611 TypeInfo = CGM.GetAddrOfRTTIDescriptor(CaughtType, /*ForEH=*/true); in EnterCXXTryStmt()
684 if (!CGM.getLangOpts().Exceptions) in getInvokeDestImpl()
735 getOpaquePersonalityFn(CGM, personality), 0); in EmitLandingPad()
867 CGF.EmitNounwindRuntimeCall(getEndCatchFn(CGF.CGM)); in Emit()
871 CGF.EmitRuntimeCallOrInvoke(getEndCatchFn(CGF.CGM)); in Emit()
884 CGF.EmitNounwindRuntimeCall(getBeginCatchFn(CGF.CGM), Exn); in CallBeginCatch()
901 CGF.CGM.getContext().getCanonicalType(CatchParam.getType()); in InitCatchParam()
926 CGF.CGM.getTargetCodeGenInfo().getSizeOfUnwindException(); in InitCatchParam()
1034 CGF.EmitNounwindRuntimeCall(getGetExceptionPtrFn(CGF.CGM), Exn); in InitCatchParam()
1125 CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for); in emitCatchDispatchBlock()
1262 EmitRuntimeCallOrInvoke(getReThrowFn(CGM)); in ExitCXXTryStmt()
1477 static bool useClangCallTerminate(CodeGenModule &CGM) { in useClangCallTerminate() argument
1479 return (CGM.getLangOpts().CPlusPlus && in useClangCallTerminate()
1480 CGM.getTarget().getCXXABI().isItaniumFamily()); in useClangCallTerminate()
1486 static llvm::Constant *getClangCallTerminateFn(CodeGenModule &CGM) { in getClangCallTerminateFn() argument
1488 llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false); in getClangCallTerminateFn()
1490 CGM.CreateRuntimeFunction(fnTy, "__clang_call_terminate"); in getClangCallTerminateFn()
1509 llvm::BasicBlock::Create(CGM.getLLVMContext(), "", fn); in getClangCallTerminateFn()
1516 llvm::CallInst *catchCall = builder.CreateCall(getBeginCatchFn(CGM), exn); in getClangCallTerminateFn()
1518 catchCall->setCallingConv(CGM.getRuntimeCC()); in getClangCallTerminateFn()
1521 llvm::CallInst *termCall = builder.CreateCall(getTerminateFn(CGM)); in getClangCallTerminateFn()
1524 termCall->setCallingConv(CGM.getRuntimeCC()); in getClangCallTerminateFn()
1544 const EHPersonality &Personality = EHPersonality::get(CGM.getLangOpts()); in getTerminateLandingPad()
1547 getOpaquePersonalityFn(CGM, Personality), 0); in getTerminateLandingPad()
1551 if (useClangCallTerminate(CGM)) { in getTerminateLandingPad()
1554 terminateCall = EmitNounwindRuntimeCall(getClangCallTerminateFn(CGM), exn); in getTerminateLandingPad()
1556 terminateCall = EmitNounwindRuntimeCall(getTerminateFn(CGM)); in getTerminateLandingPad()
1578 if (useClangCallTerminate(CGM)) { in getTerminateHandler()
1581 terminateCall = EmitNounwindRuntimeCall(getClangCallTerminateFn(CGM), exn); in getTerminateHandler()
1583 terminateCall = EmitNounwindRuntimeCall(getTerminateFn(CGM)); in getTerminateHandler()
1603 const EHPersonality &Personality = EHPersonality::get(CGM.getLangOpts()); in getEHResumeBlock()
1609 EmitRuntimeCall(getCatchallRethrowFn(CGM, RethrowName), in getEHResumeBlock()
1633 CGM.ErrorUnsupported(&S, "SEH __try"); in EmitSEHTryStmt()
1637 CGM.ErrorUnsupported(&S, "SEH __leave"); in EmitSEHLeaveStmt()