Home | History | Annotate | Download | only in CodeGen

Lines Matching full:cgf

116     EmitLoadOfMemberFunctionPointer(CodeGenFunction &CGF,
124 EmitMemberDataPointerAddress(CodeGenFunction &CGF, const Expr *E,
129 llvm::Value *EmitMemberPointerConversion(CodeGenFunction &CGF,
144 llvm::Value *EmitMemberPointerComparison(CodeGenFunction &CGF,
149 llvm::Value *EmitMemberPointerIsNotNull(CodeGenFunction &CGF,
153 void emitVirtualObjectDelete(CodeGenFunction &CGF, const CXXDeleteExpr *DE,
162 void emitRethrow(CodeGenFunction &CGF, bool isNoReturn) override;
163 void emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E) override;
165 void emitBeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *C) override;
168 emitTerminateForUnexpectedException(CodeGenFunction &CGF,
181 void EmitBadTypeidCall(CodeGenFunction &CGF) override;
182 llvm::Value *EmitTypeid(CodeGenFunction &CGF, QualType SrcRecordTy,
189 llvm::Value *EmitDynamicCastCall(CodeGenFunction &CGF, Address Value,
194 llvm::Value *EmitDynamicCastToVoid(CodeGenFunction &CGF, Address Value,
198 bool EmitBadCastCall(CodeGenFunction &CGF) override;
201 GetVirtualBaseClassOffset(CodeGenFunction &CGF, Address This,
220 void addImplicitStructorParams(CodeGenFunction &CGF, QualType &ResTy,
223 void EmitInstanceFunctionProlog(CodeGenFunction &CGF) override;
225 unsigned addImplicitConstructorArgs(CodeGenFunction &CGF,
231 void EmitDestructorCall(CodeGenFunction &CGF, const CXXDestructorDecl *DD,
238 bool isVirtualOffsetNeededForVTableField(CodeGenFunction &CGF,
250 CodeGenFunction &CGF, const CXXRecordDecl *VTableClass,
254 CodeGenFunction &CGF, const CXXRecordDecl *VTableClass,
264 llvm::Value *getVirtualFunctionPointer(CodeGenFunction &CGF, GlobalDecl GD,
268 llvm::Value *EmitVirtualDestructorCall(CodeGenFunction &CGF,
286 llvm::Value *performThisAdjustment(CodeGenFunction &CGF, Address This,
289 llvm::Value *performReturnAdjustment(CodeGenFunction &CGF, Address Ret,
303 Address InitializeArrayCookie(CodeGenFunction &CGF,
308 llvm::Value *readArrayCookieImpl(CodeGenFunction &CGF,
312 void EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D,
315 void registerGlobalDtor(CodeGenFunction &CGF, const VarDecl &D,
327 LValue EmitThreadLocalVarDeclLValue(CodeGenFunction &CGF, const VarDecl *VD,
413 void EmitReturnFromThunk(CodeGenFunction &CGF, RValue RV,
417 Address InitializeArrayCookie(CodeGenFunction &CGF,
422 llvm::Value *readArrayCookieImpl(CodeGenFunction &CGF, Address allocPtr,
520 CodeGenFunction &CGF, const Expr *E, Address ThisAddr,
523 CGBuilderTy &Builder = CGF.Builder;
535 llvm::BasicBlock *FnVirtual = CGF.createBasicBlock("memptr.virtual");
536 llvm::BasicBlock *FnNonVirtual = CGF.createBasicBlock("memptr.nonvirtual");
537 llvm::BasicBlock *FnEnd = CGF.createBasicBlock("memptr.end");
571 CGF.EmitBlock(FnVirtual);
576 CGF.CGM.getDynamicOffsetAlignment(ThisAddr.getAlignment(), RD,
577 CGF.getPointerAlign());
579 CGF.GetVTablePtr(Address(This, VTablePtrAlign), VTableTy, RD);
590 Builder.CreateAlignedLoad(VTable, CGF.getPointerAlign(),
592 CGF.EmitBranch(FnEnd);
596 CGF.EmitBlock(FnNonVirtual);
601 CGF.EmitBlock(FnEnd);
611 CodeGenFunction &CGF, const Expr *E, Address Base, llvm::Value *MemPtr,
615 CGBuilderTy &Builder = CGF.Builder;
618 Base = Builder.CreateElementBitCast(Base, CGF.Int8Ty);
626 llvm::Type *PType = CGF.ConvertTypeForMem(MPT->getPointeeType())
655 ItaniumCXXABI::EmitMemberPointerConversion(CodeGenFunction &CGF,
672 CGBuilderTy &Builder = CGF.Builder;
865 ItaniumCXXABI::EmitMemberPointerComparison(CodeGenFunction &CGF,
870 CGBuilderTy &Builder = CGF.Builder;
939 ItaniumCXXABI::EmitMemberPointerIsNotNull(CodeGenFunction &CGF,
942 CGBuilderTy &Builder = CGF.Builder;
996 void ItaniumCXXABI::emitVirtualObjectDelete(CodeGenFunction &CGF,
1010 CGF.GetVTablePtr(Ptr, CGF.IntPtrTy->getPointerTo(), ClassDecl);
1013 llvm::Value *OffsetPtr = CGF.Builder.CreateConstInBoundsGEP1_64(
1016 CGF.Builder.CreateAlignedLoad(OffsetPtr, CGF.getPointerAlign());
1020 CGF.Builder.CreateBitCast(Ptr.getPointer(), CGF.Int8PtrTy);
1021 CompletePtr = CGF.Builder.CreateInBoundsGEP(CompletePtr, Offset);
1025 CGF.pushCallObjectDeleteCleanup(DE->getOperatorDelete(), CompletePtr,
1032 EmitVirtualDestructorCall(CGF, Dtor, DtorType, Ptr, /*CE=*/nullptr);
1035 CGF.PopCleanupBlock();
1038 void ItaniumCXXABI::emitRethrow(CodeGenFunction &CGF, bool isNoReturn) {
1047 CGF.EmitNoreturnRuntimeCallOrInvoke(Fn, None);
1049 CGF.EmitRuntimeCallOrInvoke(Fn);
1072 void ItaniumCXXABI::emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E) {
1075 llvm::Type *SizeTy = CGF.ConvertType(getContext().getSizeType());
1079 llvm::CallInst *ExceptionPtr = CGF.EmitNounwindRuntimeCall(
1083 CGF.EmitAnyExprToExn(E->getSubExpr(), Address(ExceptionPtr, ExnAlign));
1103 CGF.EmitNoreturnRuntimeCallOrInvoke(getThrowFn(CGM), args);
1106 static llvm::Constant *getItaniumDynamicCastFn(CodeGenFunction &CGF) {
1112 llvm::Type *Int8PtrTy = CGF.Int8PtrTy;
1114 CGF.ConvertType(CGF.getContext().getPointerDiffType());
1124 CGF.getLLVMContext(), llvm::AttributeSet::FunctionIndex, FuncAttrs);
1126 return CGF.CGM.CreateRuntimeFunction(FTy, "__dynamic_cast", Attrs);
1129 static llvm::Constant *getBadCastFn(CodeGenFunction &CGF) {
1131 llvm::FunctionType *FTy = llvm::FunctionType::get(CGF.VoidTy, false);
1132 return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_bad_cast");
1187 static llvm::Constant *getBadTypeidFn(CodeGenFunction &CGF) {
1189 llvm::FunctionType *FTy = llvm::FunctionType::get(CGF.VoidTy, false);
1191 return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_bad_typeid");
1199 void ItaniumCXXABI::EmitBadTypeidCall(CodeGenFunction &CGF) {
1200 llvm::Value *Fn = getBadTypeidFn(CGF);
1201 CGF.EmitRuntimeCallOrInvoke(Fn).setDoesNotReturn();
1202 CGF.Builder.CreateUnreachable();
1205 llvm::Value *ItaniumCXXABI::EmitTypeid(CodeGenFunction &CGF,
1212 CGF.GetVTablePtr(ThisPtr, StdTypeInfoPtrTy->getPointerTo(), ClassDecl);
1215 Value = CGF.Builder.CreateConstInBoundsGEP1_64(Value, -1ULL);
1216 return CGF.Builder.CreateAlignedLoad(Value, CGF.getPointerAlign());
1225 CodeGenFunction &CGF, Address ThisAddr, QualType SrcRecordTy,
1228 CGF.ConvertType(CGF.getContext().getPointerDiffType());
1229 llvm::Type *DestLTy = CGF.ConvertType(DestTy);
1232 CGF.CGM.GetAddrOfRTTIDescriptor(SrcRecordTy.getUnqualifiedType());
1234 CGF.CGM.GetAddrOfRTTIDescriptor(DestRecordTy.getUnqualifiedType());
1241 computeOffsetHint(CGF.getContext(), SrcDecl, DestDecl).getQuantity());
1245 Value = CGF.EmitCastToVoidPtr(Value);
1248 Value = CGF.EmitNounwindRuntimeCall(getItaniumDynamicCastFn(CGF), args);
1249 Value = CGF.Builder.CreateBitCast(Value, DestLTy);
1255 CGF.createBasicBlock("dynamic_cast.bad_cast");
1257 llvm::Value *IsNull = CGF.Builder.CreateIsNull(Value);
1258 CGF.Builder.CreateCondBr(IsNull, BadCastBlock, CastEnd);
1260 CGF.EmitBlock(BadCastBlock);
1261 EmitBadCastCall(CGF);
1267 llvm::Value *ItaniumCXXABI::EmitDynamicCastToVoid(CodeGenFunction &CGF,
1272 CGF.ConvertType(CGF.getContext().getPointerDiffType());
1273 llvm::Type *DestLTy = CGF.ConvertType(DestTy);
1278 llvm::Value *VTable = CGF.GetVTablePtr(ThisAddr, PtrDiffLTy->getPointerTo(),
1283 CGF.Builder.CreateConstInBoundsGEP1_64(VTable, -2ULL);
1285 CGF.Builder.CreateAlignedLoad(OffsetToTop, CGF.getPointerAlign(),
1290 Value = CGF.EmitCastToVoidPtr(Value);
1291 Value = CGF.Builder.CreateInBoundsGEP(Value, OffsetToTop);
1293 return CGF.Builder.CreateBitCast(Value, DestLTy);
1296 bool ItaniumCXXABI::EmitBadCastCall(CodeGenFunction &CGF) {
1297 llvm::Value *Fn = getBadCastFn(CGF);
1298 CGF.EmitRuntimeCallOrInvoke(Fn).setDoesNotReturn();
1299 CGF.Builder.CreateUnreachable();
1304 ItaniumCXXABI::GetVirtualBaseClassOffset(CodeGenFunction &CGF,
1308 llvm::Value *VTablePtr = CGF.GetVTablePtr(This, CGM.Int8PtrTy, ClassDecl);
1314 CGF.Builder.CreateConstGEP1_64(VTablePtr, VBaseOffsetOffset.getQuantity(),
1316 VBaseOffsetPtr = CGF.Builder.CreateBitCast(VBaseOffsetPtr,
1320 CGF.Builder.CreateAlignedLoad(VBaseOffsetPtr, CGF.getPointerAlign(),
1372 void ItaniumCXXABI::addImplicitStructorParams(CodeGenFunction &CGF,
1375 const CXXMethodDecl *MD = cast<CXXMethodDecl>(CGF.CurGD.getDecl());
1379 if (NeedsVTTParameter(CGF.CurGD)) {
1388 getStructorImplicitParamDecl(CGF) = VTTDecl;
1392 void ItaniumCXXABI::EmitInstanceFunctionProlog(CodeGenFunction &CGF) {
1394 EmitThisParam(CGF);
1397 if (getStructorImplicitParamDecl(CGF)) {
1398 getStructorImplicitParamValue(CGF) = CGF.Builder.CreateLoad(
1399 CGF.GetAddrOfLocalVar(getStructorImplicitParamDecl(CGF)), "vtt");
1410 if (HasThisReturn(CGF.CurGD))
1411 CGF.Builder.CreateStore(getThisValue(CGF), CGF.ReturnValue);
1415 CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type,
1422 CGF.GetVTTParameter(GlobalDecl(D, Type), ForVirtualBase, Delegating);
1429 void ItaniumCXXABI::EmitDestructorCall(CodeGenFunction &CGF,
1434 llvm::Value *VTT = CGF.GetVTTParameter(GD, ForVirtualBase, Delegating);
1439 Callee = CGF.BuildAppleKextVirtualDestructorCall(DD, Type, DD->getParent());
1444 CGF.EmitCXXMemberOrOperatorCall(DD, Callee, ReturnValueSlot(),
1497 CodeGenFunction &CGF, CodeGenFunction::VPtr Vptr) {
1500 return NeedsVTTParameter(CGF.CurGD);
1504 CodeGenFunction &CGF, const CXXRecordDecl *VTableClass, BaseSubobject Base,
1508 NeedsVTTParameter(CGF.CurGD)) {
1509 return getVTableAddressPointInStructorWithVTT(CGF, VTableClass, Base,
1534 CodeGenFunction &CGF, const CXXRecordDecl *VTableClass, BaseSubobject Base,
1537 NeedsVTTParameter(CGF.CurGD) && "This class doesn't have VTT");
1544 llvm::Value *VTT = CGF.LoadCXXVTT();
1546 VTT = CGF.Builder.CreateConstInBoundsGEP1_64(VTT, VirtualPointerIndex);
1549 return CGF.Builder.CreateAlignedLoad(VTT, CGF.getPointerAlign());
1588 llvm::Value *ItaniumCXXABI::getVirtualFunctionPointer(CodeGenFunction &CGF,
1596 llvm::Value *VTable = CGF.GetVTablePtr(This, Ty, MethodDecl->getParent());
1599 if (CGF.ShouldEmitVTableTypeCheckedLoad(MethodDecl->getParent())) {
1600 return CGF.EmitVTableTypeCheckedLoad(
1604 CGF.EmitTypeMetadataCodeForVCall(MethodDecl->getParent(), VTable, Loc);
1607 CGF.Builder.CreateConstInBoundsGEP1_64(VTable, VTableIndex, "vfn");
1608 return CGF.Builder.CreateAlignedLoad(VFuncPtr, CGF.getPointerAlign());
1613 CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, CXXDtorType DtorType,
1620 llvm::Type *Ty = CGF.CGM.getTypes().GetFunctionType(*FInfo);
1622 getVirtualFunctionPointer(CGF, GlobalDecl(Dtor, DtorType), This, Ty,
1625 CGF.EmitCXXMemberOrOperatorCall(Dtor, Callee, ReturnValueSlot(),
1649 static llvm::Value *performTypeAdjustment(CodeGenFunction &CGF,
1657 Address V = CGF.Builder.CreateElementBitCast(InitialPtr, CGF.Int8Ty);
1661 V = CGF.Builder.CreateConstInBoundsByteGEP(V,
1669 CGF.ConvertType(CGF.getContext().getPointerDiffType());
1671 Address VTablePtrPtr = CGF.Builder.CreateElementBitCast(V, CGF.Int8PtrTy);
1672 llvm::Value *VTablePtr = CGF.Builder.CreateLoad(VTablePtrPtr);
1675 CGF.Builder.CreateConstInBoundsGEP1_64(VTablePtr, VirtualAdjustment);
1677 OffsetPtr = CGF.Builder.CreateBitCast(OffsetPtr, PtrDiffTy->getPointerTo());
1681 CGF.Builder.CreateAlignedLoad(OffsetPtr, CGF.getPointerAlign());
1684 ResultPtr = CGF.Builder.CreateInBoundsGEP(V.getPointer(), Offset);
1692 ResultPtr = CGF.Builder.CreateConstInBoundsGEP1_64(ResultPtr,
1697 return CGF.Builder.CreateBitCast(ResultPtr, InitialPtr.getType());
1700 llvm::Value *ItaniumCXXABI::performThisAdjustment(CodeGenFunction &CGF,
1703 return performTypeAdjustment(CGF, This, TA.NonVirtual,
1709 ItaniumCXXABI::performReturnAdjustment(CodeGenFunction &CGF, Address Ret,
1711 return performTypeAdjustment(CGF, Ret, RA.NonVirtual,
1716 void ARMCXXABI::EmitReturnFromThunk(CodeGenFunction &CGF,
1718 if (!isa<CXXDestructorDecl>(CGF.CurGD.getDecl()))
1719 return ItaniumCXXABI::EmitReturnFromThunk(CGF, RV, ResultType);
1722 llvm::Type *T = CGF.ReturnValue.getElementType();
1724 return ItaniumCXXABI::EmitReturnFromThunk(CGF, Undef, ResultType);
1736 Address ItaniumCXXABI::InitializeArrayCookie(CodeGenFunction &CGF,
1746 CharUnits SizeSize = CGF.getSizeSize();
1757 CookiePtr = CGF.Builder.CreateConstInBoundsByteGEP(CookiePtr, CookieOffset);
1761 CGF.Builder.CreateElementBitCast(CookiePtr, CGF.SizeTy);
1762 llvm::Instruction *SI = CGF.Builder.CreateStore(NumElements, NumElementsPtr);
1773 CGF.Builder.CreateCall(F, NumElementsPtr.getPointer());
1778 return CGF.Builder.CreateConstInBoundsByteGEP(NewPtr, CookieSize);
1781 llvm::Value *ItaniumCXXABI::readArrayCookieImpl(CodeGenFunction &CGF,
1786 CharUnits numElementsOffset = cookieSize - CGF.getSizeSize();
1789 CGF.Builder.CreateConstInBoundsByteGEP(numElementsPtr, numElementsOffset);
1792 numElementsPtr = CGF.Builder.CreateElementBitCast(numElementsPtr, CGF.SizeTy);
1794 return CGF.Builder.CreateLoad(numElementsPtr);
1801 llvm::FunctionType::get(CGF.SizeTy, CGF.SizeTy->getPointerTo(0), false);
1804 return CGF.Builder.CreateCall(F, numElementsPtr.getPointer());
1820 Address ARMCXXABI::InitializeArrayCookie(CodeGenFunction &CGF,
1831 cookie = CGF.Builder.CreateElementBitCast(cookie, CGF.SizeTy);
1832 llvm::Value *elementSize = llvm::ConstantInt::get(CGF.SizeTy,
1834 CGF.Builder.CreateStore(elementSize, cookie);
1837 cookie = CGF.Builder.CreateConstInBoundsGEP(cookie, 1, CGF.getSizeSize());
1838 CGF.Builder.CreateStore(numElements, cookie);
1843 return CGF.Builder.CreateConstInBoundsByteGEP(newPtr, cookieSize);
1846 llvm::Value *ARMCXXABI::readArrayCookieImpl(CodeGenFunction &CGF,
1852 = CGF.Builder.CreateConstInBoundsByteGEP(allocPtr, CGF.getSizeSize());
1854 numElementsPtr = CGF.Builder.CreateElementBitCast(numElementsPtr, CGF.SizeTy);
1855 return CGF.Builder.CreateLoad(numElementsPtr);
1899 void Emit(CodeGenFunction &CGF, Flags flags) override {
1900 CGF.EmitNounwindRuntimeCall(getGuardAbortFn(CGF.CGM, Guard->getType()),
1908 void ItaniumCXXABI::EmitGuardedInit(CodeGenFunction &CGF,
1912 CGBuilderTy &Builder = CGF.Builder;
1934 guardTy = CGF.Int8Ty;
1940 guardTy = CGF.SizeTy;
1941 guardAlignment = CGF.getSizeAlign();
1943 guardTy = CGF.Int64Ty;
1983 CGF.CurFn->setComdat(C);
2049 llvm::BasicBlock *InitCheckBlock = CGF.createBasicBlock("init.check");
2050 llvm::BasicBlock *EndBlock = CGF.createBasicBlock("init.end");
2055 CGF.EmitBlock(InitCheckBlock);
2061 = CGF.EmitNounwindRuntimeCall(getGuardAcquireFn(CGM, guardPtrTy), guard);
2063 llvm::BasicBlock *InitBlock = CGF.createBasicBlock("init");
2069 CGF.EHStack.pushCleanup<CallGuardAbort>(EHCleanup, guard);
2071 CGF.EmitBlock(InitBlock);
2075 CGF.EmitCXXGlobalVarDeclInit(D, var, shouldPerformInit);
2079 CGF.PopCleanupBlock();
2082 CGF.EmitNounwindRuntimeCall(getGuardReleaseFn(CGM, guardPtrTy),
2088 CGF.EmitBlock(EndBlock);
2092 static void emitGlobalDtorWithCXAAtExit(CodeGenFunction &CGF,
2098 const llvm::Triple &T = CGF.getTarget().getTriple();
2106 llvm::FunctionType::get(CGF.VoidTy, CGF.Int8PtrTy, false)->getPointerTo();
2109 llvm::Type *paramTys[] = { dtorTy, CGF.Int8PtrTy, CGF.Int8PtrTy };
2111 llvm::FunctionType::get(CGF.IntTy, paramTys, false);
2114 llvm::Constant *atexit = CGF.CGM.CreateRuntimeFunction(atexitTy, Name);
2120 CGF.CGM.CreateRuntimeVariable(CGF.Int8Ty, "__dso_handle");
2124 llvm::ConstantExpr::getBitCast(addr, CGF.Int8PtrTy),
2127 CGF.EmitNounwindRuntimeCall(atexit, args);
2131 void ItaniumCXXABI::registerGlobalDtor(CodeGenFunction &CGF,
2137 return emitGlobalDtorWithCXAAtExit(CGF, dtor, addr, D.getTLSKind());
2149 CGF.registerGlobalDtorWithAtExit(D, dtor, addr);
2338 LValue ItaniumCXXABI::EmitThreadLocalVarDeclLValue(CodeGenFunction &CGF,
2341 llvm::Value *Val = CGF.CGM.GetAddrOfGlobalVar(VD);
2344 llvm::CallInst *CallVal = CGF.Builder.CreateCall(Wrapper);
2345 if (isThreadWrapperReplaceable(VD, CGF.CGM))
2350 LV = CGF.MakeNaturalAlignAddrLValue(CallVal, LValType);
2352 LV = CGF.MakeAddrLValue(CallVal, LValType,
2353 CGF.getContext().getDeclAlign(VD));
3572 void Emit(CodeGenFunction &CGF, Flags flags) override {
3574 CGF.EmitNounwindRuntimeCall(getEndCatchFn(CGF.CGM));
3578 CGF.EmitRuntimeCallOrInvoke(getEndCatchFn(CGF.CGM));
3587 static llvm::Value *CallBeginCatch(CodeGenFunction &CGF,
3591 CGF.EmitNounwindRuntimeCall(getBeginCatchFn(CGF.CGM), Exn);
3593 CGF.EHStack.pushCleanup<CallEndCatch>(NormalAndEHCleanup, EndMightThrow);
3600 static void InitCatchParam(CodeGenFunction &CGF,
3605 llvm::Value *Exn = CGF.getExceptionFromSlot();
3608 CGF.CGM.getContext().getCanonicalType(CatchParam.getType());
3609 llvm::Type *LLVMCatchTy = CGF.ConvertTypeForMem(CatchType);
3618 llvm::Value *AdjustedExn = CallBeginCatch(CGF, Exn, EndCatchMightThrow);
3633 CGF.CGM.getTargetCodeGenInfo().getSizeOfUnwindException();
3634 AdjustedExn = CGF.Builder.CreateConstGEP1_32(Exn, HeaderSize);
3657 CGF.CreateTempAlloca(PtrTy, CGF.getPointerAlign(), "exn.byref.tmp");
3658 llvm::Value *Casted = CGF.Builder.CreateBitCast(AdjustedExn, PtrTy);
3659 CGF.Builder.CreateStore(Casted, ExnPtrTmp);
3667 CGF.Builder.CreateBitCast(AdjustedExn, LLVMCatchTy, "exn.byref");
3668 CGF.Builder.CreateStore(ExnCast, ParamAddr);
3673 TypeEvaluationKind TEK = CGF.getEvaluationKind(CatchType);
3675 llvm::Value *AdjustedExn = CallBeginCatch(CGF, Exn, false);
3681 CGF.Builder.CreateBitCast(AdjustedExn, LLVMCatchTy, "exn.casted");
3685 CastExn = CGF.EmitARCRetainNonBlock(CastExn);
3691 CGF.Builder.CreateStore(CastExn, ParamAddr);
3695 CGF.EmitARCInitWeak(ParamAddr, CastExn);
3704 llvm::Value *Cast = CGF.Builder.CreateBitCast(AdjustedExn, PtrTy);
3706 LValue srcLV = CGF.MakeNaturalAlignAddrLValue(Cast, CatchType);
3707 LValue destLV = CGF.MakeAddrLValue(ParamAddr, CatchType);
3710 CGF.EmitStoreOfComplex(CGF.EmitLoadOfComplex(srcLV, Loc), destLV,
3714 llvm::Value *ExnLoad = CGF.EmitLoadOfScalar(srcLV, Loc);
3715 CGF.EmitStoreOfScalar(ExnLoad, destLV, /*init*/ true);
3726 CharUnits caughtExnAlignment = CGF.CGM.getClassPointerAlignment(catchRD);
3734 llvm::Value *rawAdjustedExn = CallBeginCatch(CGF, Exn, true);
3735 Address adjustedExn(CGF.Builder.CreateBitCast(rawAdjustedExn, PtrTy),
3737 CGF.EmitAggregateCopy(ParamAddr, adjustedExn, CatchType);
3744 CGF.EmitNounwindRuntimeCall(getGetExceptionPtrFn(CGF.CGM), Exn);
3747 Address adjustedExn(CGF.Builder.CreateBitCast(rawAdjustedExn, PtrTy),
3753 opaque(CGF, OpaqueValueExpr::findInCopyConstruct(copyExpr),
3754 CGF.MakeAddrLValue(adjustedExn, CatchParam.getType()));
3757 CGF.EHStack.pushTerminate();
3760 CGF.EmitAggExpr(copyExpr,
3767 CGF.EHStack.popTerminate();
3773 CallBeginCatch(CGF, Exn, true);
3778 void ItaniumCXXABI::emitBeginCatch(CodeGenFunction &CGF,
3805 llvm::Value *Exn = CGF.getExceptionFromSlot();
3806 CallBeginCatch(CGF, Exn, true);
3811 CodeGenFunction::AutoVarEmission var = CGF.EmitAutoVarAlloca(*CatchParam);
3812 InitCatchParam(CGF, *CatchParam, var.getObjectAddress(CGF), S->getLocStart());
3813 CGF.EmitAutoVarCleanups(var);
3869 ItaniumCXXABI::emitTerminateForUnexpectedException(CodeGenFunction &CGF,
3873 assert(CGF.CGM.getLangOpts().CPlusPlus);
3874 return CGF.EmitNounwindRuntimeCall(getClangCallTerminateFn(CGF.CGM), Exn);
3876 return CGF.EmitNounwindRuntimeCall(CGF.CGM.getTerminateFn());