reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/CodeGen/CGObjCGNU.cpp
  183     const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
  189     return (StringRef(CGM.getTriple().isOSBinFormatCOFF() ? "$_" : "._") + Name).str();
  205     ConstantAddress Array = CGM.GetAddrOfConstantCString(Str, Name);
  239         CGM.getContext().getObjCEncodingForPropertyDecl(PD, Container);
  289             CGM.getContext().getCharWidth());
  302     ASTContext &Context = CGM.getContext();
  603         CGM.getContext().getObjCEncodingForMethodDecl(M));
  709     MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy);
  711     MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
  808       const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
  814       SlotLookupFn.init(&CGM, "objc_msg_lookup_sender", SlotTy, PtrToIdTy,
  817       SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy,
  823           ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy);
  824       } else if (CGM.getLangOpts().CPlusPlus) {
  827         EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy);
  829         ExitCatchFn.init(&CGM, "__cxa_end_catch", VoidTy);
  831         ExceptionReThrowFn.init(&CGM, "_Unwind_Resume_or_Rethrow", VoidTy,
  836         EnterCatchFn.init(&CGM, "objc_begin_catch", IdTy, PtrTy);
  838         ExitCatchFn.init(&CGM, "objc_end_catch", VoidTy);
  840         ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy, PtrTy);
  843       SetPropertyAtomic.init(&CGM, "objc_setProperty_atomic", VoidTy, IdTy,
  845       SetPropertyAtomicCopy.init(&CGM, "objc_setProperty_atomic_copy", VoidTy,
  847       SetPropertyNonAtomic.init(&CGM, "objc_setProperty_nonatomic", VoidTy,
  849       SetPropertyNonAtomicCopy.init(&CGM, "objc_setProperty_nonatomic_copy",
  853       CxxAtomicObjectSetFn.init(&CGM, "objc_setCppObjectAtomic", VoidTy, PtrTy,
  857       CxxAtomicObjectGetFn.init(&CGM, "objc_getCppObjectAtomic", VoidTy, PtrTy,
  864       assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
  872       assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
  882       assert ((CGM.getLangOpts().getGC() == LangOptions::NonGC));
  885       assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
  916     if (CGM.getTriple().isOSBinFormatCOFF()) {
  963     llvm::FunctionCallee Fn = CGM.CreateRuntimeFunction(FT, FunctionName);
  970     CharUnits Align = CGM.getPointerAlign();
  981     if ((CGM.getTarget().getPointerWidth(0) == 64) &&
 1000     StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
 1011       if (CGM.getTriple().isOSBinFormatCOFF()) {
 1027     ConstantInitBuilder Builder(CGM);
 1029     if (!CGM.getTriple().isOSBinFormatCOFF()) {
 1104     if (CGM.getTriple().isOSBinFormatCOFF()) {
 1128     ASTContext &Context = CGM.getContext();
 1131       CGM.getContext().getObjCEncodingForPropertyDecl(property, OCD);
 1157       llvm::StructType::get(CGM.getLLVMContext(),
 1159     ASTContext &Context = CGM.getContext();
 1160     ConstantInitBuilder Builder(CGM);
 1173         CGM.getContext().getCharWidth());
 1184                                             CGM.getPointerAlign());
 1222       if (CGM.getTriple().isOSBinFormatCOFF()) {
 1223         IdentifierInfo &II = CGM.getContext().Idents.get(Name);
 1224         TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl();
 1255           CGM.getPointerAlign()));
 1297       GV->setAlignment(CGM.getPointerAlign().getAsAlign());
 1321       GV->setAlignment(CGM.getPointerAlign().getAsAlign());
 1325     return CGF.Builder.CreateAlignedLoad(Ref, CGM.getPointerAlign());
 1333     ConstantInitBuilder builder(CGM);
 1339         CGM.getPointerAlign(), false, llvm::GlobalValue::InternalLinkage);
 1387     ConstantInitBuilder builder(CGM);
 1407         CGM.getPointerAlign(), false, llvm::GlobalValue::ExternalLinkage);
 1461     ConstantInitBuilder builder(CGM);
 1467         CGM.getPointerAlign(), false, llvm::GlobalValue::LinkOnceODRLinkage);
 1485     if (CGM.getTriple().isOSBinFormatCOFF()) {
 1500         Sym->setAlignment(CGM.getPointerAlign().getAsAlign());
 1518     return CGM.getCXXABI().getCatchAllTypeInfo();
 1530     CGBuilderTy B(CGM, VMContext);
 1532     ConstantInitBuilder builder(CGM);
 1535     auto &sectionVec = CGM.getTriple().isOSBinFormatCOFF() ? PECOFFSectionsBaseNames : SectionsBaseNames;
 1542         CGM.getPointerAlign(), false, llvm::GlobalValue::LinkOnceODRLinkage);
 1549     CGM.addCompilerUsedGlobal(LoadFunction);
 1564     if (CGM.getTriple().isOSBinFormatCOFF())
 1568       if (CGM.getCodeGenOpts().UseInitArray)
 1575     CGM.addUsedGlobal(InitVar);
 1579       CGM.addUsedGlobal(Cat);
 1586       auto GV = nullBuilder.finishAndCreateGlobal(Name, CGM.getPointerAlign(),
 1591       CGM.addUsedGlobal(GV);
 1602     if (!CGM.getTriple().isOSBinFormatCOFF()) {
 1637       auto *Init = llvm::Function::Create(llvm::FunctionType::get(CGM.VoidTy,
 1639           &CGM.getModule());
 1640       llvm::IRBuilder<> b(llvm::BasicBlock::Create(CGM.getLLVMContext(), "entry",
 1646               b.CreateStructGEP(lateInit.second.first, lateInit.second.second), CGM.getPointerAlign().getQuantity());
 1652       auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), 
 1656       CGM.addUsedGlobal(InitVar);
 1665     CGM.getContext().getObjCEncodingForType(Ivar->getType(), TypeEncoding);
 1681     CharUnits Align = CGM.getIntAlign();
 1688     ASTContext &Context = CGM.getContext();
 1689     bool IsCOFF = CGM.getTriple().isOSBinFormatCOFF();
 1697     ConstantInitBuilder builder(CGM);
 1750         CGM.getPointerAlign());
 1807       ConstantInitBuilder b(CGM);
 1819           CGM.getContext().getCharWidth());
 1834         uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
 1855             CGM.getContext().getTypeSizeInChars(ivarTy).getQuantity());
 1872           CGM.getPointerAlign(), /*constant*/ false,
 1927         CGM.getPointerAlign(), false, llvm::GlobalValue::ExternalLinkage);
 1976     CGM.addUsedGlobal(classInitRef);
 1982       MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
 1993         llvm::StructType::get(CGM.getLLVMContext(),
 2046     if (CGM.ReturnTypeUsesSRet(MSI.CallInfo))
 2062     if (CGM.ReturnTypeUsesSRet(MSI.CallInfo))
 2086     MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy);
 2087     MsgLookupFnSRet.init(&CGM, "objc_msg_lookup_stret", IMPTy, IdTy,
 2090     MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
 2092     MsgLookupSuperFnSRet.init(&CGM, "objc_msg_lookup_super_stret", IMPTy,
 2119   : CGObjCRuntime(cgm), TheModule(CGM.getModule()),
 2128   CodeGenTypes &Types = CGM.getTypes();
 2130       Types.ConvertType(CGM.getContext().IntTy));
 2132       Types.ConvertType(CGM.getContext().LongTy));
 2134       Types.ConvertType(CGM.getContext().getSizeType()));
 2136       Types.ConvertType(CGM.getContext().getPointerDiffType()));
 2137   BoolTy = CGM.getTypes().ConvertType(CGM.getContext().BoolTy);
 2137   BoolTy = CGM.getTypes().ConvertType(CGM.getContext().BoolTy);
 2143       Types.ConvertType(CGM.getContext().getObjCProtoType()));
 2149   QualType selTy = CGM.getContext().getObjCSelType();
 2153     SelectorTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(selTy));
 2163       CGM.getDataLayout().getPointerSizeInBits() == 32 ? Int32Ty : Int64Ty;
 2166   QualType UnqualIdTy = CGM.getContext().getObjCIdType();
 2169     ASTIdTy = CGM.getContext().getCanonicalType(UnqualIdTy);
 2170     IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
 2197   PropertyMetadataTy = llvm::StructType::get(CGM.getLLVMContext(), {
 2207   ExceptionThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy);
 2208   ExceptionReThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy);
 2210   SyncEnterFn.init(&CGM, "objc_sync_enter", IntTy, IdTy);
 2212   SyncExitFn.init(&CGM, "objc_sync_exit", IntTy, IdTy);
 2215   EnumerationMutationFn.init(&CGM, "objc_enumerationMutation", VoidTy, IdTy);
 2218   GetPropertyFn.init(&CGM, "objc_getProperty", IdTy, IdTy, SelectorTy,
 2221   SetPropertyFn.init(&CGM, "objc_setProperty", VoidTy, IdTy, SelectorTy,
 2224   GetStructPropertyFn.init(&CGM, "objc_getPropertyStruct", VoidTy, PtrTy, PtrTy,
 2227   SetStructPropertyFn.init(&CGM, "objc_setPropertyStruct", VoidTy, PtrTy, PtrTy,
 2235   const LangOptions &Opts = CGM.getLangOpts();
 2245     RetainSel = GetNullarySelector("retain", CGM.getContext());
 2246     ReleaseSel = GetNullarySelector("release", CGM.getContext());
 2247     AutoreleaseSel = GetNullarySelector("autorelease", CGM.getContext());
 2252     IvarAssignFn.init(&CGM, "objc_assign_ivar", IdTy, IdTy, IdTy, PtrDiffTy);
 2254     StrongCastAssignFn.init(&CGM, "objc_assign_strongCast", IdTy, IdTy,
 2257     GlobalAssignFn.init(&CGM, "objc_assign_global", IdTy, IdTy, PtrToIdTy);
 2259     WeakAssignFn.init(&CGM, "objc_assign_weak", IdTy, IdTy, PtrToIdTy);
 2261     WeakReadFn.init(&CGM, "objc_read_weak", IdTy, PtrToIdTy);
 2263     MemMoveFn.init(&CGM, "objc_memmove_collectable", PtrTy, PtrTy, PtrTy,
 2281   llvm::FunctionCallee ClassLookupFn = CGM.CreateRuntimeFunction(
 2293     CGM.setGVProperties(ClassSymbol, OID);
 2299   if (CGM.getTriple().isOSBinFormatCOFF()) {
 2302       TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl();
 2310       CGM.setGVProperties(ClassSymbol, VD);
 2355   std::string SelTypes = CGM.getContext().getObjCEncodingForMethodDecl(Method);
 2365     if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
 2382     return CGM.getCXXABI().getAddrOfRTTIDescriptor(T);
 2384   if (!CGM.getLangOpts().CPlusPlus)
 2394       CGM.getModule().getGlobalVariable("__objc_id_type_info");
 2397         new llvm::GlobalVariable(CGM.getModule(), PtrToInt8Ty,
 2438   ConstantInitBuilder builder(CGM);
 2444                                  CGM.getPointerAlign(),
 2454   CharUnits Align = CGM.getPointerAlign();
 2461   StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
 2476   ConstantInitBuilder Builder(CGM);
 2504   if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
 2507                   CGM.getTypes().ConvertType(ResultType)));
 2540         classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
 2543         classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
 2624   if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
 2627                   CGM.getTypes().ConvertType(ResultType)));
 2663   IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
 2692   switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
 2698       if (CGM.ReturnTypeUsesFPRet(ResultType)) {
 2700             CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
 2703       } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) {
 2707             CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
 2711         imp = CGM.CreateRuntimeFunction(
 2773   ConstantInitBuilder Builder(CGM);
 2776   MethodList.addNullPointer(CGM.Int8PtrTy);
 2781     llvm::StructType::get(CGM.getLLVMContext(), {
 2791         CGM.getContext().getCharWidth());
 2793       llvm::StructType::get(CGM.getLLVMContext(), {
 2800       llvm::StructType::get(CGM.getLLVMContext(), {
 2807   ASTContext &Context = CGM.getContext();
 2831                                           CGM.getPointerAlign());
 2844   ConstantInitBuilder Builder(CGM);
 2867                                         CGM.getPointerAlign());
 2916   ConstantInitBuilder Builder(CGM);
 2936                       CGM.getContext().getCharWidth());
 2972     Elements.finishAndCreateGlobal(ClassSym, CGM.getPointerAlign(), false,
 2987     llvm::StructType::get(CGM.getLLVMContext(), { PtrToInt8Ty, PtrToInt8Ty });
 2988   ASTContext &Context = CGM.getContext();
 2989   ConstantInitBuilder Builder(CGM);
 3001                                           CGM.getPointerAlign());
 3008   ConstantInitBuilder Builder(CGM);
 3028                                             CGM.getPointerAlign());
 3037     CGM.getTypes().ConvertType(CGM.getContext().getObjCProtoType());
 3037     CGM.getTypes().ConvertType(CGM.getContext().getObjCProtoType());
 3048   ConstantInitBuilder Builder(CGM);
 3065                                         CGM.getPointerAlign());
 3119   ConstantInitBuilder Builder(CGM);
 3134       Elements.finishAndCreateGlobal(".objc_protocol", CGM.getPointerAlign()),
 3140   ConstantInitBuilder Builder(CGM);
 3155   ConstantInitBuilder ProtocolListBuilder(CGM);
 3167                                                       CGM.getPointerAlign()),
 3170         Elements.finishAndCreateGlobal("", CGM.getPointerAlign()),
 3187   int ptrBits = CGM.getDataLayout().getPointerSizeInBits();
 3206   ConstantInitBuilder builder(CGM);
 3235   ConstantInitBuilder Builder(CGM);
 3273           CGM.getPointerAlign()),
 3285   ASTContext &Context = CGM.getContext();
 3340   ConstantInitBuilder builder(CGM);
 3363                                             CGM.getPointerAlign());
 3375   ASTContext &Context = CGM.getContext();
 3414   ConstantInitBuilder IvarOffsetBuilder(CGM);
 3423   if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
 3438       uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
 3440       if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
 3481                                            CGM.getPointerAlign());
 3574   CGM.setGVProperties(cast<llvm::GlobalValue>(MetaClassStruct),
 3583   CGM.setGVProperties(cast<llvm::GlobalValue>(ClassStruct),
 3618     selStructTy = llvm::StructType::get(CGM.getLLVMContext(),
 3627       ConstantInitBuilder builder(CGM);
 3630       StringRef stringClass = CGM.getLangOpts().ObjCConstantStringClass;
 3641                                                  CGM.getPointerAlign());
 3644     ConstantInitBuilder builder(CGM);
 3650                                                     CGM.getPointerAlign());
 3661     ConstantInitBuilder builder(CGM);
 3702                                            CGM.getPointerAlign());
 3722     ConstantInitBuilder builder(CGM);
 3731     symtab.addInt(CGM.Int16Ty, Classes.size());
 3733     symtab.addInt(CGM.Int16Ty, Categories.size());
 3745     return symtab.finishAndCreateGlobal("", CGM.getPointerAlign());
 3755       llvm::StructType::get(CGM.getLLVMContext(),
 3758     ConstantInitBuilder builder(CGM);
 3763     module.addInt(LongTy, CGM.getDataLayout().getTypeStoreSize(moduleTy));
 3766     SourceManager &SM = CGM.getContext().getSourceManager();
 3774       switch (CGM.getLangOpts().getGC()) {
 3779         if (CGM.getLangOpts().ObjCAutoRefCount)
 3790     return module.finishAndCreateGlobal("", CGM.getPointerAlign());
 3801   CGBuilderTy Builder(CGM, VMContext);
 3807       CGM.CreateRuntimeFunction(FT, "__objc_exec_class");
 3862   CodeGenTypes &Types = CGM.getTypes();
 4067   if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
 4068     Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
 4084     CharUnits Align = CGM.getIntAlign();
tools/clang/lib/CodeGen/CGObjCMac.cpp
 1551     IdentifierInfo* II = &CGM.getContext().Idents.get(name);
 1552     return CGM.getContext().Selectors.getSelector(0, &II);
 1556     IdentifierInfo* II = &CGM.getContext().Idents.get(name);
 1557     return CGM.getContext().Selectors.getSelector(1, &II);
 1900     return CGM.GetAddrOfRTTIDescriptor(
 1901               CGM.getContext().getObjCIdRedefinitionType(), /*ForEH=*/true);
 1905     return CGM.GetAddrOfRTTIDescriptor(
 1906              CGM.getContext().getObjCClassRedefinitionType(), /*ForEH=*/true);
 1909     return CGM.GetAddrOfRTTIDescriptor(T,  /*ForEH=*/true);
 1935   return (!CGM.getLangOpts().NoConstantCFStrings
 1936             ? CGM.GetAddrOfConstantCFString(SL)
 1952   auto &StringClass = CGM.getLangOpts().ObjCConstantStringClass;
 1957   llvm::Type *PTy = llvm::ArrayType::get(CGM.IntTy, 0);
 1958   auto GV = CGM.CreateRuntimeVariable(PTy, str);
 1959   auto V = llvm::ConstantExpr::getBitCast(GV, CGM.IntTy->getPointerTo());
 1968   auto &StringClass = CGM.getLangOpts().ObjCConstantStringClass;
 1975   auto V = llvm::ConstantExpr::getBitCast(GV, CGM.IntTy->getPointerTo());
 1997         CGM.Int32Ty->getPointerTo(),
 1998         CGM.Int8PtrTy,
 1999         CGM.IntTy
 2003   ConstantInitBuilder Builder(CGM);
 2014   bool isConstant = !CGM.getLangOpts().WritableStrings;
 2016   auto *GV = new llvm::GlobalVariable(CGM.getModule(), C->getType(), isConstant,
 2022   Fields.addBitCast(GV, CGM.Int8PtrTy);
 2025   Fields.addInt(CGM.IntTy, StringLength);
 2028   CharUnits Alignment = CGM.getPointerAlign();
 2036   GV->setSection(CGM.getLangOpts().ObjCRuntime.isNonFragile()
 2103     CGM.getTypes().ConvertType(CGF.getContext().getObjCClassType());
 2159     assert(CGM.getContext().getCanonicalType(Method->getReturnType()) ==
 2160                CGM.getContext().getCanonicalType(ResultType) &&
 2193   if (CGM.ReturnSlotInterferesWithArgs(MSI.CallInfo)) {
 2197   } else if (CGM.ReturnTypeUsesFPRet(ResultType)) {
 2200   } else if (CGM.ReturnTypeUsesFP2Ret(ResultType)) {
 2206     if (ReceiverCanBeNull && CGM.ReturnTypeUsesSRet(MSI.CallInfo))
 2222   if (!RequiresNullCheck && CGM.getLangOpts().ObjCAutoRefCount && Method) {
 2444   if (CGM.getLangOpts().ObjCAutoRefCount)
 2491   unsigned ByteSizeInBits = CGM.getTarget().getCharWidth();
 2497     const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(RD);
 2499       CGM.getContext().toCharUnitsFromBits(RL.getFieldOffset(i));
 2519     if (const ArrayType *Array = CGM.getContext().getAsArrayType(FQT)) {
 2524       while (const ArrayType *Array = CGM.getContext().getAsArrayType(FQT)) {
 2539           CharUnits Size = CGM.getContext().getTypeSizeInChars(RT);
 2549     CharUnits FieldSize = CGM.getContext().getTypeSizeInChars(Field->getType());
 2569         = LastFieldBitfieldOrUnnamed->getBitWidthValue(CGM.getContext());
 2583         = CGM.getContext().getTypeSizeInChars(LastFieldBitfieldOrUnnamed->getType());
 2605   llvm::Type *Ty = CGM.getTypes().ConvertType(QualType(RT, 0));
 2607     CGM.getDataLayout().getStructLayout(cast<llvm::StructType>(Ty));
 2719   llvm::Constant *nullPtr = llvm::Constant::getNullValue(CGM.Int8PtrTy);
 2722   unsigned WordSizeInBits = CGM.getTarget().getPointerWidth(0);
 2723   unsigned ByteSizeInBits = CGM.getTarget().getCharWidth();
 2793     if (CGM.getLangOpts().ObjCGCBitmapPrint) {
 2807     return llvm::ConstantInt::get(CGM.IntPtrTy, Result);
 2816   if (CGM.getLangOpts().ObjCGCBitmapPrint) {
 2989   LazySymbols.insert(&CGM.getContext().Idents.get("Protocol"));
 3058   LazySymbols.insert(&CGM.getContext().Idents.get("Protocol"));
 3063   ConstantInitBuilder builder(CGM);
 3080                                          CGM.getPointerAlign(),
 3087   CGM.addCompilerUsedGlobal(Entry);
 3099     Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolTy,
 3152     CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ProtocolExtensionTy);
 3154   ConstantInitBuilder builder(CGM);
 3165                            StringRef(), CGM.getPointerAlign(), true);
 3183   ConstantInitBuilder builder(CGM);
 3205   if (CGM.getTriple().isOSBinFormatMachO())
 3209       CreateMetadataVar(name, values, section, CGM.getPointerAlign(), false);
 3250     const llvm::Triple &Triple = CGM.getTarget().getTriple();
 3292     CGM.getDataLayout().getTypeAllocSize(ObjCTypes.PropertyTy);
 3294   ConstantInitBuilder builder(CGM);
 3308   if (CGM.getTriple().isOSBinFormatMachO())
 3313       CreateMetadataVar(Name, values, Section, CGM.getPointerAlign(), true);
 3330   if (CGM.getTriple().isOSBinFormatMachO() && ObjCABI == 2)
 3334       CreateMetadataVar(Name, Init, Section, CGM.getPointerAlign(), true);
 3351   unsigned Size = CGM.getDataLayout().getTypeAllocSize(ObjCTypes.CategoryTy);
 3365   ConstantInitBuilder Builder(CGM);
 3409                         CGM.getPointerAlign(), true);
 3521       &CGM.getContext().Idents.get(ID->getObjCRuntimeNameAsString());
 3538   if (CGM.getLangOpts().ObjCAutoRefCount)
 3540   else if ((hasMRCWeak = hasMRCWeakIvars(CGM, ID)))
 3544     CGM.getContext().getASTObjCImplementationLayout(ID).getSize();
 3573   ConstantInitBuilder builder(CGM);
 3604   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3610     GV->setAlignment(CGM.getPointerAlign().getAsAlign());
 3611     CGM.addCompilerUsedGlobal(GV);
 3613     GV = CreateMetadataVar(Name, values, Section, CGM.getPointerAlign(), true);
 3624   unsigned Size = CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ClassTy);
 3629   ConstantInitBuilder builder(CGM);
 3667   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3673     GV = values.finishAndCreateGlobal(Name, CGM.getPointerAlign(),
 3678   CGM.addCompilerUsedGlobal(GV);
 3694   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3696     GV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
 3707   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true);
 3710     GV = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ClassTy, false,
 3737     layout = llvm::ConstantPointerNull::get(CGM.Int8PtrTy);
 3756     CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ClassExtensionTy);
 3758   ConstantInitBuilder builder(CGM);
 3766                            CGM.getPointerAlign(), true);
 3793   ConstantInitBuilder builder(CGM);
 3807     ivar.addInt(ObjCTypes.IntTy, ComputeIvarBaseOffset(CGM, OID, IVD));
 3827                           CGM.getPointerAlign(), true);
 3831                            CGM.getPointerAlign(), true);
 3940     ConstantInitBuilder builder(CGM);
 3950                                                  CGM.getPointerAlign(), true);
 3956   ConstantInitBuilder builder(CGM);
 3967                                                CGM.getPointerAlign(), true);
 3976   CodeGenTypes &Types = CGM.getTypes();
 3983                            &CGM.getModule());
 3995       getLinkageTypeForObjCMetadata(CGM, Section);
 4001     CGM.addCompilerUsedGlobal(GV);
 4012       getLinkageTypeForObjCMetadata(CGM, Section);
 4014       new llvm::GlobalVariable(CGM.getModule(), Ty, false, LT, Init, Name);
 4019     CGM.addCompilerUsedGlobal(GV);
 4059       new llvm::GlobalVariable(CGM.getModule(), Value->getType(),
 4062   if (CGM.getTriple().isOSBinFormatMachO())
 4066   CGM.addCompilerUsedGlobal(GV);
 4806     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 4808     src = (Size == 4) ? CGF.Builder.CreateBitCast(src, CGM.Int32Ty)
 4809                       : CGF.Builder.CreateBitCast(src, CGM.Int64Ty);
 4827     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 4829     src = (Size == 4) ? CGF.Builder.CreateBitCast(src, CGM.Int32Ty)
 4830                       : CGF.Builder.CreateBitCast(src, CGM.Int64Ty);
 4853     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 4855     src = (Size == 4) ? CGF.Builder.CreateBitCast(src, CGM.Int32Ty)
 4856                       : CGF.Builder.CreateBitCast(src, CGM.Int64Ty);
 4872     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 4874     src = (Size == 4) ? CGF.Builder.CreateBitCast(src, CGM.Int32Ty)
 4875                       : CGF.Builder.CreateBitCast(src, CGM.Int64Ty);
 4911   uint64_t Offset = ComputeIvarBaseOffset(CGM, Interface, Ivar);
 4913     CGM.getTypes().ConvertType(CGM.getContext().LongTy),
 4913     CGM.getTypes().ConvertType(CGM.getContext().LongTy),
 4921   switch (CGM.getTriple().getObjectFormat()) {
 4976   llvm::Module &Mod = CGM.getModule();
 4985   if (CGM.getLangOpts().getGC() == LangOptions::NonGC) {
 4995     if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
 5011   if (CGM.getTarget().getTriple().isSimulatorEnvironment())
 5031   uint64_t Size = CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ModuleTy);
 5033   ConstantInitBuilder builder(CGM);
 5042                     CGM.getPointerAlign(), true);
 5053   ConstantInitBuilder builder(CGM);
 5080       CGM.getPointerAlign(), true);
 5097         CGM.getPointerAlign(), true);
 5111       &CGM.getContext().Idents.get(ID->getObjCRuntimeNameAsString());
 5116   IdentifierInfo *II = &CGM.getContext().Idents.get("NSAutoreleasePool");
 5424   llvm::Type *PtrTy = CGM.Int8PtrTy;
 5425   if (CGM.getLangOpts().getGC() == LangOptions::NonGC &&
 5426       !CGM.getLangOpts().ObjCAutoRefCount &&
 5444   if (CGM.getLangOpts().getGC() == LangOptions::NonGC) {
 5453         CharUnits::fromQuantity(ComputeIvarBaseOffset(CGM, OMD, ivars[0]));
 5458     baseOffset = baseOffset.alignTo(CGM.getPointerAlign());
 5461     CGM.getContext().DeepCollectObjCIvars(OI, true, ivars);
 5469   IvarLayoutBuilder builder(CGM, baseOffset, endOffset, ForStrongLayout);
 5473       return CharUnits::fromQuantity(ComputeIvarBaseOffset(CGM, OMD, ivar));
 5482    if (CGM.getLangOpts().ObjCGCBitmapPrint && !buffer.empty()) {
 5501   return GetMethodVarName(CGM.getContext().Selectors.getNullarySelector(ID));
 5506   CGM.getContext().getObjCEncodingForType(Field->getType(), TypeStr, Field);
 5517     CGM.getContext().getObjCEncodingForMethodDecl(D, Extended);
 5539     CGM.getContext().getObjCEncodingForPropertyDecl(PD, Container);
 5540   return GetPropertyName(&CGM.getContext().Idents.get(TypeStr));
 5566     ConstantInitBuilder builder(CGM);
 5574     CGM.addCompilerUsedGlobal(global);
 5583       CGM.getTriple().isOSBinFormatMachO()) {
 5585     Asm += CGM.getModule().getModuleInlineAsm();
 5599     CGM.getModule().setModuleInlineAsm(OS.str());
 6069   assert((!CGM.getTriple().isOSBinFormatMachO() ||
 6073       getLinkageTypeForObjCMetadata(CGM, SectionName);
 6075     new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false, LT, Init,
 6078       llvm::Align(CGM.getDataLayout().getABITypeAlignment(Init->getType())));
 6080   CGM.addCompilerUsedGlobal(GV);
 6130   switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
 6151     if (CGM.getLangOpts().getGC() != LangOptions::GCOnly) {
 6167     if (CGM.getLangOpts().getGC() != LangOptions::NonGC) {
 6173         &CGM.getContext().Idents.get("countByEnumeratingWithState"),
 6174         &CGM.getContext().Idents.get("objects"),
 6175         &CGM.getContext().Idents.get("count")
 6178         CGM.getContext().Selectors.getSelector(3, KeyIdents));
 6211   if (CGM.getLangOpts().ObjCAutoRefCount)
 6213   else if ((hasMRCWeak = hasMRCWeakIvars(CGM, ID)))
 6216   ConstantInitBuilder builder(CGM);
 6283   return finishAndCreateGlobal(values, roLabel, CGM);
 6303   ConstantInitBuilder builder(CGM);
 6319   if (CGM.getTriple().isOSBinFormatMachO())
 6322       CGM.getDataLayout().getABITypeAlignment(ObjCTypes.ClassnfABITy)));
 6323   if (!CGM.getTriple().isOSBinFormatCOFF())
 6340     CGM.getContext().getASTObjCImplementationLayout(OID);
 6349     InstanceStart = RL.getFieldOffset(0) / CGM.getContext().getCharWidth();
 6375         new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.CacheTy, false,
 6378     if (CGM.getTriple().isOSBinFormatCOFF())
 6379       ObjCEmptyCacheVar->setDLLStorageClass(getStorage(CGM, "_objc_empty_cache"));
 6382     const llvm::Triple &Triple = CGM.getTarget().getTriple();
 6385           new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ImpnfABITy, false,
 6395     CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ClassnfABITy);
 6405   bool classIsHidden = (CGM.getTriple().isOSBinFormatCOFF())
 6442   CGM.setGVProperties(MetaTClass, CI);
 6463   if (hasObjCExceptionAttribute(CGM.getContext(), CI))
 6482   CGM.setGVProperties(ClassMD, CI);
 6520   llvm::GlobalVariable *PTGV = CGM.getModule().getGlobalVariable(ProtocolName);
 6523   PTGV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
 6530   if (!CGM.getTriple().isOSBinFormatMachO())
 6531     PTGV->setComdat(CGM.getModule().getOrInsertComdat(ProtocolName));
 6532   CGM.addUsedGlobal(PTGV);
 6557   ConstantInitBuilder builder(CGM);
 6601   unsigned Size = CGM.getDataLayout().getTypeAllocSize(ObjCTypes.CategorynfABITy);
 6605       finishAndCreateGlobal(values, ExtCatName.str(), CGM);
 6606   CGM.addCompilerUsedGlobal(GCATV);
 6701   ConstantInitBuilder builder(CGM);
 6705   unsigned Size = CGM.getDataLayout().getTypeAllocSize(ObjCTypes.MethodTy);
 6715   llvm::GlobalVariable *GV = finishAndCreateGlobal(values, prefix + name, CGM);
 6716   CGM.addCompilerUsedGlobal(GV);
 6730   llvm::GlobalVariable *IvarOffsetGV = CGM.getModule().getGlobalVariable(Name);
 6733         new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.IvarOffsetVarTy,
 6736     if (CGM.getTriple().isOSBinFormatCOFF()) {
 6762       CGM.getDataLayout().getABITypeAlignment(ObjCTypes.IvarOffsetVarTy)));
 6764   if (!CGM.getTriple().isOSBinFormatCOFF()) {
 6781   if (CGM.getTriple().isOSBinFormatMachO())
 6806   ConstantInitBuilder builder(CGM);
 6809                   CGM.getDataLayout().getTypeAllocSize(ObjCTypes.IvarnfABITy));
 6826                                ComputeIvarBaseOffset(CGM, ID, IVD)));
 6830       CGM.getTypes().ConvertTypeForMem(IVD->getType());
 6831     unsigned Size = CGM.getDataLayout().getTypeAllocSize(FieldTy);
 6832     unsigned Align = CGM.getContext().getPreferredTypeAlign(
 6857       ivarList, Prefix + OID->getObjCRuntimeNameAsString(), CGM);
 6858   CGM.addCompilerUsedGlobal(GV);
 6874     Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABITy,
 6877     if (!CGM.getTriple().isOSBinFormatMachO())
 6878       Entry->setComdat(CGM.getModule().getOrInsertComdat(Protocol));
 6919   ConstantInitBuilder builder(CGM);
 6941     CGM.getDataLayout().getTypeAllocSize(ObjCTypes.ProtocolnfABITy);
 6965     Entry = values.finishAndCreateGlobal(symbolName, CGM.getPointerAlign(),
 6968     if (!CGM.getTriple().isOSBinFormatMachO())
 6969       Entry->setComdat(CGM.getModule().getOrInsertComdat(symbolName));
 6974   CGM.addUsedGlobal(Entry);
 6983     new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.ProtocolnfABIPtrTy,
 6986   if (!CGM.getTriple().isOSBinFormatMachO())
 6987     PTGV->setComdat(CGM.getModule().getOrInsertComdat(ProtocolRef));
 6989       CGM.getDataLayout().getABITypeAlignment(ObjCTypes.ProtocolnfABIPtrTy)));
 6993   CGM.addUsedGlobal(PTGV);
 7019     CGM.getModule().getGlobalVariable(TmpName.str(), true);
 7023   ConstantInitBuilder builder(CGM);
 7037   GV = finishAndCreateGlobal(values, Name, CGM);
 7038   CGM.addCompilerUsedGlobal(GV);
 7069         ComputeIvarBaseOffset(CGM, Interface->getImplementation(), Ivar));
 7076           ->setMetadata(CGM.getModule().getMDKindID("invariant.load"),
 7149   if (CGM.ReturnSlotInterferesWithArgs(MSI.CallInfo)) {
 7158   } else if (!isSuper && CGM.ReturnTypeUsesFPRet(resultType)) {
 7178     = CGM.getModule().getGlobalVariable(messageRefName);
 7181     ConstantInitBuilder builder(CGM);
 7194   if (CGM.getLangOpts().ObjCAutoRefCount && method)
 7253                           && CGM.getTriple().isOSBinFormatCOFF()
 7265   llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
 7279     CGM.getModule().getGlobalList().push_back(GV);
 7298   auto *Idx = llvm::ConstantInt::get(CGM.Int32Ty, 1);
 7299   return llvm::ConstantExpr::getGetElementPtr(CGM.Int8Ty, ClassGV, Idx);
 7337         CGM.getModule(), ClassGV->getType(), false,
 7338         getLinkageTypeForObjCMetadata(CGM, SectionName), ClassGV,
 7344     CGM.addCompilerUsedGlobal(Entry);
 7362   IdentifierInfo *II = &CGM.getContext().Idents.get("NSAutoreleasePool");
 7376         CGM.getModule(), ClassGV->getType(), false,
 7377         getLinkageTypeForObjCMetadata(CGM, SectionName), ClassGV,
 7381     CGM.addCompilerUsedGlobal(Entry);
 7400         CGM.getModule(), ObjCTypes.ClassnfABIPtrTy, false,
 7401         getLinkageTypeForObjCMetadata(CGM, SectionName), MetaClassGV,
 7405     CGM.addCompilerUsedGlobal(Entry);
 7461     CGM.getTypes().ConvertType(CGF.getContext().getObjCClassType());
 7480   LI->setMetadata(CGM.getModule().getMDKindID("invariant.load"),
 7497         CGM.getModule(), ObjCTypes.SelectorPtrTy, false,
 7498         getLinkageTypeForObjCMetadata(CGM, SectionName), Casted,
 7503     CGM.addCompilerUsedGlobal(Entry);
 7518     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 7538     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 7584     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 7605     unsigned Size = CGM.getDataLayout().getTypeAllocSize(SrcTy);
 7633     auto *IDEHType = CGM.getModule().getGlobalVariable("OBJC_EHTYPE_id");
 7636           new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy, false,
 7639       if (CGM.getTriple().isOSBinFormatCOFF())
 7640         IDEHType->setDLLStorageClass(getStorage(CGM, "OBJC_EHTYPE_id"));
 7697     if (hasObjCExceptionAttribute(CGM.getContext(), ID)) {
 7699       Entry = new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.EHTypeTy,
 7702       CGM.setGVProperties(Entry, ID);
 7711   auto *VTableGV = CGM.getModule().getGlobalVariable(VTableName);
 7714         new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.Int8PtrTy, false,
 7717     if (CGM.getTriple().isOSBinFormatCOFF())
 7718       VTableGV->setDLLStorageClass(getStorage(CGM, VTableName));
 7721   llvm::Value *VTableIdx = llvm::ConstantInt::get(CGM.Int32Ty, 2);
 7722   ConstantInitBuilder builder(CGM);
 7735     Entry->setAlignment(CGM.getPointerAlign().getAsAlign());
 7738                                          CGM.getPointerAlign(),
 7741     if (hasObjCExceptionAttribute(CGM.getContext(), ID))
 7742       CGM.setGVProperties(Entry, ID);
 7746   if (!CGM.getTriple().isOSBinFormatCOFF())
 7751     if (CGM.getTriple().isOSBinFormatMachO())
tools/clang/lib/CodeGen/CGObjCRuntime.cpp
  195         CodeGenFunction HelperCGF(CGM, /*suppressNewContext=*/true);
  366       CGM.getTypes().arrangeObjCMessageSendSignature(method, callArgs[0].Ty);
  369       CGM.getTypes().GetFunctionType(signature)->getPointerTo();
  372       CGM.getTypes().arrangeCall(signature, callArgs);
  379     CGM.getTypes().arrangeUnprototypedObjCMessageSend(resultType, callArgs);
  383     CGM.getTypes().GetFunctionType(argsInfo)->getPointerTo();