Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:CGM

66     return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
79 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.VoidTy,
92 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.DoubleTy,
109 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(resultType,
121 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
132 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
143 return CGM.CreateRuntimeFunction(
144 llvm::FunctionType::get(CGM.VoidTy, params, true),
154 return CGM.CreateRuntimeFunction(
155 llvm::FunctionType::get(CGM.VoidTy, params, true),
170 CodeGen::CodeGenModule &CGM;
195 CodeGen::CodeGenTypes &Types = CGM.getTypes();
196 ASTContext &Ctx = CGM.getContext();
233 CodeGen::CodeGenTypes &Types = CGM.getTypes();
234 ASTContext &Ctx = CGM.getContext();
247 return CGM.CreateRuntimeFunction(FTy, "objc_getProperty");
251 CodeGen::CodeGenTypes &Types = CGM.getTypes();
252 ASTContext &Ctx = CGM.getContext();
267 return CGM.CreateRuntimeFunction(FTy, "objc_setProperty");
271 CodeGen::CodeGenTypes &Types = CGM.getTypes();
272 ASTContext &Ctx = CGM.getContext();
303 return CGM.CreateRuntimeFunction(FTy, name);
307 CodeGen::CodeGenTypes &Types = CGM.getTypes();
308 ASTContext &Ctx = CGM.getContext();
320 return CGM.CreateRuntimeFunction(FTy, "objc_copyStruct");
328 CodeGen::CodeGenTypes &Types = CGM.getTypes();
329 ASTContext &Ctx = CGM.getContext();
339 return CGM.CreateRuntimeFunction(FTy, "objc_copyCppObjectAtomic");
343 CodeGen::CodeGenTypes &Types = CGM.getTypes();
344 ASTContext &Ctx = CGM.getContext();
352 return CGM.CreateRuntimeFunction(FTy, "objc_enumerationMutation");
361 return CGM.CreateRuntimeFunction(FTy, "objc_read_weak");
370 return CGM.CreateRuntimeFunction(FTy, "objc_assign_weak");
379 return CGM.CreateRuntimeFunction(FTy, "objc_assign_global");
388 return CGM.CreateRuntimeFunction(FTy, "objc_assign_threadlocal");
395 CGM.PtrDiffTy };
398 return CGM.CreateRuntimeFunction(FTy, "objc_assign_ivar");
406 return CGM.CreateRuntimeFunction(FTy, "objc_memmove_collectable");
415 return CGM.CreateRuntimeFunction(FTy, "objc_assign_strongCast");
423 llvm::FunctionType::get(CGM.VoidTy, args, false);
424 return CGM.CreateRuntimeFunction(FTy, "objc_exception_throw");
430 llvm::FunctionType *FTy = llvm::FunctionType::get(CGM.VoidTy, false);
431 return CGM.CreateRuntimeFunction(FTy, "objc_exception_rethrow");
439 llvm::FunctionType::get(CGM.IntTy, args, false);
440 return CGM.CreateRuntimeFunction(FTy, "objc_sync_enter");
448 llvm::FunctionType::get(CGM.IntTy, args, false);
449 return CGM.CreateRuntimeFunction(FTy, "objc_sync_exit");
484 ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm);
549 return CGM.CreateRuntimeFunction(
550 llvm::FunctionType::get(CGM.VoidTy, params, false),
557 return CGM.CreateRuntimeFunction(
558 llvm::FunctionType::get(CGM.VoidTy, params, false),
565 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
573 return CGM.CreateRuntimeFunction(
574 llvm::FunctionType::get(CGM.Int32Ty, params, false),
582 llvm::Type *params[] = { CGM.Int32Ty->getPointerTo() };
583 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
590 ObjCTypesHelper(CodeGen::CodeGenModule &cgm);
673 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
681 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
689 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
698 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
707 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
713 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.VoidTy, false),
720 return CGM.CreateRuntimeFunction(llvm::FunctionType::get(Int8PtrTy,
728 ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm);
940 CGObjCCommonMac(CodeGen::CodeGenModule &cgm) :
941 CGObjCRuntime(cgm), VMContext(cgm.getLLVMContext()) { }
960 virtual llvm::Constant *BuildGCBlockLayout(CodeGen::CodeGenModule &CGM,
1076 CGObjCMac(CodeGen::CodeGenModule &cgm);
1319 IdentifierInfo* II = &CGM.getContext().Idents.get(name);
1320 return CGM.getContext().Selectors.getSelector(0, &II);
1324 IdentifierInfo* II = &CGM.getContext().Idents.get(name);
1325 return CGM.getContext().Selectors.getSelector(1, &II);
1333 CGObjCNonFragileABIMac(CodeGen::CodeGenModule &cgm);
1557 CGObjCMac::CGObjCMac(CodeGen::CodeGenModule &cgm) : CGObjCCommonMac(cgm),
1558 ObjCTypes(cgm) {
1583 return CGM.GetAddrOfRTTIDescriptor(
1584 CGM.getContext().getObjCIdRedefinitionType(), /*ForEH=*/true);
1588 return CGM.GetAddrOfRTTIDescriptor(
1589 CGM.getContext().getObjCClassRedefinitionType(), /*ForEH=*/true);
1592 return CGM.GetAddrOfRTTIDescriptor(T, /*ForEH=*/true);
1618 return (CGM.getLangOpts().NoConstantCFStrings == 0 ?
1619 CGM.GetAddrOfConstantCFString(SL) :
1620 CGM.GetAddrOfConstantString(SL));
1680 CGM.getTypes().ConvertType(CGF.getContext().getObjCClassType());
1727 assert(CGM.getContext().getCanonicalType(Method->getResultType()) ==
1728 CGM.getContext().getCanonicalType(ResultType) &&
1734 if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) {
1738 } else if (CGM.ReturnTypeUsesFPRet(ResultType)) {
1741 } else if (CGM.ReturnTypeUsesFP2Ret(ResultType)) {
1750 if (CGM.getLangOpts().ObjCAutoRefCount && Method)
1788 llvm::Constant *CGObjCCommonMac::BuildGCBlockLayout(CodeGenModule &CGM,
1790 llvm::Constant *nullPtr = llvm::Constant::getNullValue(CGM.Int8PtrTy);
1792 if (CGM.getLangOpts().getGC() == LangOptions::NonGC &&
1793 !CGM.getLangOpts().ObjCAutoRefCount)
1799 unsigned WordSizeInBits = CGM.getContext().getTargetInfo().getPointerWidth(0);
1800 unsigned ByteSizeInBits = CGM.getContext().getTargetInfo().getCharWidth();
1810 CGM.getTargetData().getStructLayout(blockInfo.StructureType);
1840 Qualifiers::GC GCAttr = GetGCAttrTypeForType(CGM.getContext(), type);
1841 unsigned fieldSize = CGM.getContext().getTypeSize(type);
1861 if (CGM.getLangOpts().ObjCGCBitmapPrint) {
1879 LazySymbols.insert(&CGM.getContext().Idents.get("Protocol"));
1929 LazySymbols.insert(&CGM.getContext().Idents.get("Protocol"));
1993 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolTy, false,
2003 CGM.AddUsedGlobal(Entry);
2016 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolTy, false,
2043 CGM.getTargetData().getTypeAllocSize(ObjCTypes.ProtocolExtensionTy);
2183 CGM.getTargetData().getTypeAllocSize(ObjCTypes.PropertyTy);
2272 unsigned Size = CGM.getTargetData().getTypeAllocSize(ObjCTypes.CategoryTy);
2386 CGM.getContext().getASTObjCImplementationLayout(ID).getSize().getQuantity();
2453 llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
2461 CGM.AddUsedGlobal(GV);
2474 unsigned Size = CGM.getTargetData().getTypeAllocSize(ObjCTypes.ClassTy);
2521 llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
2528 GV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
2534 CGM.AddUsedGlobal(GV);
2550 if (llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name,
2558 return new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
2568 if (llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name,
2574 return new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
2591 CGM.getTargetData().getTypeAllocSize(ObjCTypes.ClassExtensionTy);
2645 ComputeIvarBaseOffset(CGM, OID, IVD))
2728 CodeGenTypes &Types = CGM.getTypes();
2735 &CGM.getModule());
2749 new llvm::GlobalVariable(CGM.getModule(), Ty, false,
2756 CGM.AddUsedGlobal(GV);
3484 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
3505 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
3531 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
3551 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
3591 uint64_t Offset = ComputeIvarBaseOffset(CGM, Interface, Ivar);
3593 CGM.getTypes().ConvertType(CGM.getContext().LongTy),
3627 llvm::Module &Mod = CGM.getModule();
3636 if (CGM.getLangOpts().getGC() == LangOptions::NonGC) {
3646 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
3663 const llvm::Triple &Triple = CGM.getTarget().getTriple();
3682 uint64_t Size = CGM.getTargetData().getTypeAllocSize(ObjCTypes.ModuleTy);
3688 CGM.getContext().Idents.get("")),
3761 IdentifierInfo *II = &CGM.getContext().Idents.get("NSAutoreleasePool");
3825 llvm::Type *Ty = CGM.getTypes().ConvertType(QualType(RT, 0));
3827 CGM.getTargetData().getStructLayout(cast<llvm::StructType>(Ty));
3852 unsigned WordSizeInBits = CGM.getContext().getTargetInfo().getPointerWidth(0);
3853 unsigned ByteSizeInBits = CGM.getContext().getTargetInfo().getCharWidth();
3854 if (!RD && CGM.getLangOpts().ObjCAutoRefCount) {
3857 ComputeIvarBaseOffset(CGM, OI, cast<ObjCIvarDecl>(FirstField));
3866 const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(RD);
3870 ComputeIvarBaseOffset(CGM, OI, cast<ObjCIvarDecl>(Field)) - FirstFieldDelta;
3891 if (const ArrayType *Array = CGM.getContext().getAsArrayType(FQT)) {
3897 while (const ArrayType *Array = CGM.getContext().getAsArrayType(FQT)) {
3919 uint64_t Size = CGM.getContext().getTypeSize(RT)/ByteSizeInBits;
3932 Qualifiers::GC GCAttr = GetGCAttrTypeForType(CGM.getContext(), FQT);
3934 unsigned FieldSize = CGM.getContext().getTypeSize(Field->getType());
3972 = LastFieldBitfieldOrUnnamed->getBitWidthValue(CGM.getContext());
3982 = CGM.getContext().getTypeSize(LastFieldBitfieldOrUnnamed->getType());
4003 llvm::Type *PtrTy = CGM.Int8PtrTy;
4008 CGM.getTypes().getTargetData().getTypeAllocSize(PtrTy);
4147 llvm::Type *PtrTy = CGM.Int8PtrTy;
4148 if (CGM.getLangOpts().getGC() == LangOptions::NonGC &&
4149 !CGM.getLangOpts().ObjCAutoRefCount)
4154 if (CGM.getLangOpts().ObjCAutoRefCount) {
4161 CGM.getContext().DeepCollectObjCIvars(OI, true, Ivars);
4186 if (CGM.getLangOpts().ObjCGCBitmapPrint) {
4218 return GetMethodVarName(CGM.getContext().Selectors.getNullarySelector(ID));
4223 CGM.getContext().getObjCEncodingForType(Field->getType(), TypeStr, Field);
4241 if (CGM.getContext().getObjCEncodingForMethodDecl(D, TypeStr, Extended))
4277 CGM.getContext().getObjCEncodingForPropertyDecl(PD, Container, TypeStr);
4278 return GetPropertyName(&CGM.getContext().Idents.get(TypeStr));
4313 CGM.AddUsedGlobal(I->second);
4323 Asm += CGM.getModule().getModuleInlineAsm();
4342 CGM.getModule().setModuleInlineAsm(OS.str());
4346 CGObjCNonFragileABIMac::CGObjCNonFragileABIMac(CodeGen::CodeGenModule &cgm)
4347 : CGObjCCommonMac(cgm),
4348 ObjCTypes(cgm) {
4355 ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
4356 : VMContext(cgm.getLLVMContext()), CGM(cgm), ExternalProtocolPtrTy(0)
4358 CodeGen::CodeGenTypes &Types = CGM.getTypes();
4359 ASTContext &Ctx = CGM.getContext();
4365 Int8PtrTy = CGM.Int8PtrTy;
4366 Int8PtrPtrTy = CGM.Int8PtrPtrTy;
4434 ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
4435 : ObjCCommonTypesHelper(cgm) {
4608 llvm::Type *StackPtrTy = llvm::ArrayType::get(CGM.Int8PtrTy, 4);
4612 llvm::ArrayType::get(CGM.Int32Ty,SetJmpBufferSize),
4617 ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm)
4618 : ObjCCommonTypesHelper(cgm) {
4756 CodeGen::CodeGenTypes &Types = CGM.getTypes();
4757 ASTContext &Ctx = CGM.getContext();
4834 new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
4838 GV->setAlignment(CGM.getTargetData().getABITypeAlignment(Init->getType()));
4840 CGM.AddUsedGlobal(GV);
4889 switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
4910 if (CGM.getLangOpts().getGC() != LangOptions::GCOnly) {
4926 if (CGM.getLangOpts().getGC() != LangOptions::NonGC) {
4932 &CGM.getContext().Idents.get("countByEnumeratingWithState"),
4933 &CGM.getContext().Idents.get("objects"),
4934 &CGM.getContext().Idents.get("count")
4937 CGM.getContext().Selectors.getSelector(3, KeyIdents));
4980 if (CGM.getLangOpts().ObjCAutoRefCount)
5047 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassRonfABITy, false,
5054 CGM.getTargetData().getABITypeAlignment(ObjCTypes.ClassRonfABITy));
5091 CGM.getTargetData().getABITypeAlignment(ObjCTypes.ClassnfABITy));
5106 CGM.getContext().getASTObjCImplementationLayout(OID);
5115 InstanceStart = RL.getFieldOffset(0) / CGM.getContext().getCharWidth();
5122 CGM.getModule(),
5130 CGM.getModule(),
5141 CGM.getTargetData().getTypeAllocSize(ObjCTypes.ClassnfABITy);
5192 if (hasObjCExceptionAttribute(CGM.getContext(), ID->getClassInterface()))
5250 llvm::GlobalVariable *PTGV = CGM.getModule().getGlobalVariable(ProtocolName);
5254 CGM.getModule(),
5261 CGM.AddUsedGlobal(PTGV);
5341 = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.CategorynfABITy,
5347 CGM.getTargetData().getABITypeAlignment(ObjCTypes.CategorynfABITy));
5349 CGM.AddUsedGlobal(GCATV);
5394 unsigned Size = CGM.getTargetData().getTypeAllocSize(ObjCTypes.MethodTy);
5404 new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
5406 GV->setAlignment(CGM.getTargetData().getABITypeAlignment(Init->getType()));
5408 CGM.AddUsedGlobal(GV);
5421 CGM.getModule().getGlobalVariable(Name);
5424 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.LongTy,
5440 CGM.getTargetData().getABITypeAlignment(ObjCTypes.LongTy));
5488 ComputeIvarBaseOffset(CGM, ID, IVD));
5492 CGM.getTypes().ConvertTypeForMem(IVD->getType());
5493 unsigned Size = CGM.getTargetData().getTypeAllocSize(FieldTy);
5494 unsigned Align = CGM.getContext().getPreferredTypeAlign(
5511 unsigned Size = CGM.getTargetData().getTypeAllocSize(ObjCTypes.IvarnfABITy);
5520 new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
5525 CGM.getTargetData().getABITypeAlignment(Init->getType()));
5528 CGM.AddUsedGlobal(GV);
5541 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABITy, false,
5647 CGM.getTargetData().getTypeAllocSize(ObjCTypes.ProtocolnfABITy);
5662 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABITy,
5666 CGM.getTargetData().getABITypeAlignment(ObjCTypes.ProtocolnfABITy));
5672 CGM.AddUsedGlobal(Entry);
5677 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABIPtrTy,
5681 CGM.getTargetData().getABITypeAlignment(ObjCTypes.ProtocolnfABIPtrTy));
5684 CGM.AddUsedGlobal(PTGV);
5710 CGM.getModule().getGlobalVariable(TmpName.str(), true);
5730 GV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
5735 CGM.getTargetData().getABITypeAlignment(Init->getType()));
5736 CGM.AddUsedGlobal(GV);
5778 LI->setMetadata(CGM.getModule().getMDKindID("invariant.load"),
5852 if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) {
5861 } else if (!isSuper && CGM.ReturnTypeUsesFPRet(resultType)) {
5881 = CGM.getModule().getGlobalVariable(messageRefName);
5886 messageRef = new llvm::GlobalVariable(CGM.getModule(),
5898 if (CGM.getLangOpts().ObjCAutoRefCount && method)
5949 llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
5952 GV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABITy,
5968 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABIPtrTy,
5973 CGM.getTargetData().getABITypeAlignment(
5976 CGM.AddUsedGlobal(Entry);
5989 IdentifierInfo *II = &CGM.getContext().Idents.get("NSAutoreleasePool");
6002 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABIPtrTy,
6007 CGM.getTargetData().getABITypeAlignment(
6010 CGM.AddUsedGlobal(Entry);
6028 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassnfABIPtrTy, false,
6033 CGM.getTargetData().getABITypeAlignment(
6037 CGM.AddUsedGlobal(Entry);
6097 CGM.getTypes().ConvertType(CGF.getContext().getObjCClassType());
6121 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.SelectorPtrTy, false,
6125 CGM.AddUsedGlobal(Entry);
6132 LI->setMetadata(CGM.getModule().getMDKindID("invariant.load"),
6146 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
6167 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
6214 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
6235 unsigned Size = CGM.getTargetData().getTypeAllocSize(SrcTy);
6266 CGM.getModule().getGlobalVariable("OBJC_EHTYPE_id");
6269 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy,
6323 if (hasObjCExceptionAttribute(CGM.getContext(), ID))
6325 new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy, false,
6338 CGM.getModule().getGlobalVariable(VTableName);
6340 VTableGV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.Int8PtrTy,
6345 llvm::Value *VTableIdx = llvm::ConstantInt::get(CGM.Int32Ty, 2);
6358 Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy, false,
6365 if (CGM.getLangOpts().getVisibilityMode() == HiddenVisibility)
6367 Entry->setAlignment(CGM.getTargetData().getABITypeAlignment(
6383 CodeGen::CreateMacObjCRuntime(CodeGen::CodeGenModule &CGM) {
6384 switch (CGM.getLangOpts().ObjCRuntime.getKind()) {
6386 return new CGObjCMac(CGM);
6390 return new CGObjCNonFragileABIMac(CGM);