Lines Matching refs:CGM

48   CodeGenModule *CGM;
56 LazyRuntimeFunction() : CGM(0), FunctionName(0), Function(0) {}
63 CGM =Mod;
85 cast<llvm::Constant>(CGM->CreateRuntimeFunction(FTy, FunctionName));
173 llvm::Constant *ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str());
228 const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
233 CGM.getContext().getObjCEncodingForPropertyDecl(PD, Container, TypeStr);
241 CGM.GetAddrOfConstantString(NameAndAttributes), Zeros);
563 virtual llvm::Constant *BuildGCBlockLayout(CodeGenModule &CGM,
567 virtual llvm::Constant *BuildRCBlockLayout(CodeGenModule &CGM,
572 virtual llvm::Constant *BuildByrefLayout(CodeGenModule &CGM,
623 MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy, NULL);
625 MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
714 const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
720 SlotLookupFn.init(&CGM, "objc_msg_lookup_sender", SlotTy, PtrToIdTy,
723 SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy,
726 if (CGM.getLangOpts().CPlusPlus) {
729 EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy, NULL);
731 ExitCatchFn.init(&CGM, "__cxa_end_catch", VoidTy, NULL);
733 ExceptionReThrowFn.init(&CGM, "_Unwind_Resume_or_Rethrow", VoidTy,
738 EnterCatchFn.init(&CGM, "objc_begin_catch", IdTy, PtrTy, NULL);
740 ExitCatchFn.init(&CGM, "objc_end_catch", VoidTy, NULL);
742 ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy,
746 SetPropertyAtomic.init(&CGM, "objc_setProperty_atomic", VoidTy, IdTy,
748 SetPropertyAtomicCopy.init(&CGM, "objc_setProperty_atomic_copy", VoidTy,
750 SetPropertyNonAtomic.init(&CGM, "objc_setProperty_nonatomic", VoidTy,
752 SetPropertyNonAtomicCopy.init(&CGM, "objc_setProperty_nonatomic_copy",
756 CxxAtomicObjectSetFn.init(&CGM, "objc_setCppObjectAtomic", VoidTy, PtrTy,
760 CxxAtomicObjectGetFn.init(&CGM, "objc_getCppObjectAtomic", VoidTy, PtrTy,
766 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
773 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
782 assert ((CGM.getLangOpts().getGC() == LangOptions::NonGC));
785 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
825 if (CGM.ReturnTypeUsesSRet(MSI.CallInfo))
842 if (CGM.ReturnTypeUsesSRet(MSI.CallInfo))
870 MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy, NULL);
871 MsgLookupFnSRet.init(&CGM, "objc_msg_lookup_stret", IMPTy, IdTy,
874 MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
876 MsgLookupSuperFnSRet.init(&CGM, "objc_msg_lookup_super_stret", IMPTy,
913 : CGObjCRuntime(cgm), TheModule(CGM.getModule()),
919 CodeGenTypes &Types = CGM.getTypes();
921 Types.ConvertType(CGM.getContext().IntTy));
923 Types.ConvertType(CGM.getContext().LongTy));
925 Types.ConvertType(CGM.getContext().getSizeType()));
927 Types.ConvertType(CGM.getContext().getPointerDiffType()));
928 BoolTy = CGM.getTypes().ConvertType(CGM.getContext().BoolTy);
938 QualType selTy = CGM.getContext().getObjCSelType();
942 SelectorTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(selTy));
955 QualType UnqualIdTy = CGM.getContext().getObjCIdType();
958 ASTIdTy = CGM.getContext().getCanonicalType(UnqualIdTy);
959 IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
971 ExceptionThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy, NULL);
972 ExceptionReThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy, NULL);
974 SyncEnterFn.init(&CGM, "objc_sync_enter", IntTy, IdTy, NULL);
976 SyncExitFn.init(&CGM, "objc_sync_exit", IntTy, IdTy, NULL);
979 EnumerationMutationFn.init(&CGM, "objc_enumerationMutation", VoidTy,
983 GetPropertyFn.init(&CGM, "objc_getProperty", IdTy, IdTy, SelectorTy,
986 SetPropertyFn.init(&CGM, "objc_setProperty", VoidTy, IdTy, SelectorTy,
989 GetStructPropertyFn.init(&CGM, "objc_getPropertyStruct", VoidTy, PtrTy, PtrTy,
992 SetStructPropertyFn.init(&CGM, "objc_setPropertyStruct", VoidTy, PtrTy, PtrTy,
1000 const LangOptions &Opts = CGM.getLangOpts();
1010 RetainSel = GetNullarySelector("retain", CGM.getContext());
1011 ReleaseSel = GetNullarySelector("release", CGM.getContext());
1012 AutoreleaseSel = GetNullarySelector("autorelease", CGM.getContext());
1017 IvarAssignFn.init(&CGM, "objc_assign_ivar", IdTy, IdTy, IdTy, PtrDiffTy,
1020 StrongCastAssignFn.init(&CGM, "objc_assign_strongCast", IdTy, IdTy,
1023 GlobalAssignFn.init(&CGM, "objc_assign_global", IdTy, IdTy, PtrToIdTy,
1026 WeakAssignFn.init(&CGM, "objc_assign_weak", IdTy, IdTy, PtrToIdTy, NULL);
1028 WeakReadFn.init(&CGM, "objc_read_weak", IdTy, PtrToIdTy, NULL);
1030 MemMoveFn.init(&CGM, "objc_memmove_collectable", PtrTy, PtrTy, PtrTy,
1038 llvm::Value *ClassName = CGM.GetAddrOfConstantCString(Name);
1051 CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, PtrToInt8Ty, true),
1104 CGM.getContext().getObjCEncodingForMethodDecl(Method, SelTypes);
1114 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
1130 if (!CGM.getLangOpts().CPlusPlus)
1140 CGM.getModule().getGlobalVariable("__objc_id_type_info");
1143 new llvm::GlobalVariable(CGM.getModule(), PtrToInt8Ty,
1202 StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
1245 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
1248 CGM.getTypes().ConvertType(ResultType)));
1270 classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
1273 classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
1348 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
1351 CGM.getTypes().ConvertType(ResultType)));
1387 IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
1416 switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
1422 if (CGM.ReturnTypeUsesFPRet(ResultType)) {
1423 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1425 } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) {
1428 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1431 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1641 CGM.getContext().getCharWidth()));
1739 CGM.getTypes().ConvertType(CGM.getContext().getObjCProtoType());
1776 ASTContext &Context = CGM.getContext();
2042 CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr);
2054 CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr);
2088 ASTContext &Context = CGM.getContext();
2165 ASTContext &Context = CGM.getContext();
2209 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2222 uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
2224 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2419 StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
2536 CGM.getContext().getCharWidth()));
2539 SourceManager &SM = CGM.getContext().getSourceManager();
2547 switch (CGM.getLangOpts().getGC()) {
2552 if (CGM.getLangOpts().ObjCAutoRefCount)
2578 llvm::Value *Register = CGM.CreateRuntimeFunction(FT, "__objc_exec_class");
2634 CodeGenTypes &Types = CGM.getTypes();
2799 if (!CGM.getContext().getObjCImplementation(
2801 Offset = ComputeIvarBaseOffset(CGM, ID, Ivar);
2809 if (CGM.getLangOpts().PICLevel || CGM.getLangOpts().PIELevel) {
2855 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2856 Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
2874 uint64_t Offset = ComputeIvarBaseOffset(CGF.CGM, Interface, Ivar);
2879 clang::CodeGen::CreateGNUObjCRuntime(CodeGenModule &CGM) {
2880 switch (CGM.getLangOpts().ObjCRuntime.getKind()) {
2882 return new CGObjCGNUstep(CGM);
2885 return new CGObjCGCC(CGM);
2888 return new CGObjCObjFW(CGM);