• Home
  • Raw
  • Download

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