Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:CGM

48   CodeGenModule *CGM;
57 : CGM(nullptr), FunctionName(nullptr), Function(nullptr) {}
64 CGM =Mod;
86 cast<llvm::Constant>(CGM->CreateRuntimeFunction(FTy, FunctionName));
174 llvm::Constant *ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str());
229 const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
234 CGM.getContext().getObjCEncodingForPropertyDecl(PD, Container, TypeStr);
241 CGM.GetAddrOfConstantCString(NameAndAttributes), Zeros);
479 CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
552 llvm::Constant *BuildGCBlockLayout(CodeGenModule &CGM,
556 llvm::Constant *BuildRCBlockLayout(CodeGenModule &CGM,
561 llvm::Constant *BuildByrefLayout(CodeGenModule &CGM, QualType T) override {
608 MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy,
611 MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
697 const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
703 SlotLookupFn.init(&CGM, "objc_msg_lookup_sender", SlotTy, PtrToIdTy,
706 SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy,
709 if (CGM.getLangOpts().CPlusPlus) {
712 EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy, nullptr);
714 ExitCatchFn.init(&CGM, "__cxa_end_catch", VoidTy, nullptr);
716 ExceptionReThrowFn.init(&CGM, "_Unwind_Resume_or_Rethrow", VoidTy,
721 EnterCatchFn.init(&CGM, "objc_begin_catch", IdTy, PtrTy, nullptr);
723 ExitCatchFn.init(&CGM, "objc_end_catch", VoidTy, nullptr);
725 ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy,
729 SetPropertyAtomic.init(&CGM, "objc_setProperty_atomic", VoidTy, IdTy,
731 SetPropertyAtomicCopy.init(&CGM, "objc_setProperty_atomic_copy", VoidTy,
733 SetPropertyNonAtomic.init(&CGM, "objc_setProperty_nonatomic", VoidTy,
735 SetPropertyNonAtomicCopy.init(&CGM, "objc_setProperty_nonatomic_copy",
739 CxxAtomicObjectSetFn.init(&CGM, "objc_setCppObjectAtomic", VoidTy, PtrTy,
743 CxxAtomicObjectGetFn.init(&CGM, "objc_getCppObjectAtomic", VoidTy, PtrTy,
749 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
756 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
765 assert ((CGM.getLangOpts().getGC() == LangOptions::NonGC));
768 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
803 if (CGM.ReturnTypeUsesSRet(MSI.CallInfo))
818 if (CGM.ReturnTypeUsesSRet(MSI.CallInfo))
846 MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy, nullptr);
847 MsgLookupFnSRet.init(&CGM, "objc_msg_lookup_stret", IMPTy, IdTy,
850 MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
852 MsgLookupSuperFnSRet.init(&CGM, "objc_msg_lookup_super_stret", IMPTy,
888 CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
890 : CGObjCRuntime(cgm), TheModule(CGM.getModule()),
891 VMContext(cgm.getLLVMContext()), ClassPtrAlias(nullptr),
897 CodeGenTypes &Types = CGM.getTypes();
899 Types.ConvertType(CGM.getContext().IntTy));
901 Types.ConvertType(CGM.getContext().LongTy));
903 Types.ConvertType(CGM.getContext().getSizeType()));
905 Types.ConvertType(CGM.getContext().getPointerDiffType()));
906 BoolTy = CGM.getTypes().ConvertType(CGM.getContext().BoolTy);
916 QualType selTy = CGM.getContext().getObjCSelType();
920 SelectorTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(selTy));
930 CGM.getDataLayout().getPointerSizeInBits() == 32 ? Int32Ty : Int64Ty;
933 QualType UnqualIdTy = CGM.getContext().getObjCIdType();
936 ASTIdTy = CGM.getContext().getCanonicalType(UnqualIdTy);
937 IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
949 ExceptionThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy, nullptr);
950 ExceptionReThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy, nullptr);
952 SyncEnterFn.init(&CGM, "objc_sync_enter", IntTy, IdTy, nullptr);
954 SyncExitFn.init(&CGM, "objc_sync_exit", IntTy, IdTy, nullptr);
957 EnumerationMutationFn.init(&CGM, "objc_enumerationMutation", VoidTy,
961 GetPropertyFn.init(&CGM, "objc_getProperty", IdTy, IdTy, SelectorTy,
964 SetPropertyFn.init(&CGM, "objc_setProperty", VoidTy, IdTy, SelectorTy,
967 GetStructPropertyFn.init(&CGM, "objc_getPropertyStruct", VoidTy, PtrTy, PtrTy,
970 SetStructPropertyFn.init(&CGM, "objc_setPropertyStruct", VoidTy, PtrTy, PtrTy,
978 const LangOptions &Opts = CGM.getLangOpts();
988 RetainSel = GetNullarySelector("retain", CGM.getContext());
989 ReleaseSel = GetNullarySelector("release", CGM.getContext());
990 AutoreleaseSel = GetNullarySelector("autorelease", CGM.getContext());
995 IvarAssignFn.init(&CGM, "objc_assign_ivar", IdTy, IdTy, IdTy, PtrDiffTy,
998 StrongCastAssignFn.init(&CGM, "objc_assign_strongCast", IdTy, IdTy,
1001 GlobalAssignFn.init(&CGM, "objc_assign_global", IdTy, IdTy, PtrToIdTy,
1004 WeakAssignFn.init(&CGM, "objc_assign_weak", IdTy, IdTy, PtrToIdTy, nullptr);
1006 WeakReadFn.init(&CGM, "objc_read_weak", IdTy, PtrToIdTy, nullptr);
1008 MemMoveFn.init(&CGM, "objc_memmove_collectable", PtrTy, PtrTy, PtrTy,
1016 llvm::Value *ClassName = CGM.GetAddrOfConstantCString(Name);
1029 CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, PtrToInt8Ty, true),
1080 CGM.getContext().getObjCEncodingForMethodDecl(Method, SelTypes);
1090 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
1106 if (!CGM.getLangOpts().CPlusPlus)
1116 CGM.getModule().getGlobalVariable("__objc_id_type_info");
1119 new llvm::GlobalVariable(CGM.getModule(), PtrToInt8Ty,
1179 StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
1222 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
1225 CGM.getTypes().ConvertType(ResultType)));
1247 classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
1250 classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
1326 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
1329 CGM.getTypes().ConvertType(ResultType)));
1365 IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
1395 switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
1401 if (CGM.ReturnTypeUsesFPRet(ResultType)) {
1402 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1404 } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) {
1407 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1410 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1620 CGM.getContext().getCharWidth()));
1718 CGM.getTypes().ConvertType(CGM.getContext().getObjCProtoType());
1755 ASTContext &Context = CGM.getContext();
1973 int ptrBits = CGM.getDataLayout().getPointerSizeInBits();
2011 CGM.getContext().getObjCEncodingForMethodDecl(I,TypeStr);
2021 CGM.getContext().getObjCEncodingForMethodDecl(I,TypeStr);
2055 ASTContext &Context = CGM.getContext();
2129 ASTContext &Context = CGM.getContext();
2173 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2186 uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
2188 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2375 StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
2492 CGM.getContext().getCharWidth()));
2495 SourceManager &SM = CGM.getContext().getSourceManager();
2503 switch (CGM.getLangOpts().getGC()) {
2508 if (CGM.getLangOpts().ObjCAutoRefCount)
2534 llvm::Value *Register = CGM.CreateRuntimeFunction(FT, "__objc_exec_class");
2590 CodeGenTypes &Types = CGM.getTypes();
2755 if (!CGM.getContext().getObjCImplementation(
2757 Offset = ComputeIvarBaseOffset(CGM, ID, Ivar);
2765 if (CGM.getLangOpts().PICLevel || CGM.getLangOpts().PIELevel) {
2811 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2812 Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
2830 uint64_t Offset = ComputeIvarBaseOffset(CGF.CGM, Interface, Ivar);
2835 clang::CodeGen::CreateGNUObjCRuntime(CodeGenModule &CGM) {
2836 switch (CGM.getLangOpts().ObjCRuntime.getKind()) {
2838 return new CGObjCGNUstep(CGM);
2841 return new CGObjCGCC(CGM);
2844 return new CGObjCObjFW(CGM);