Lines Matching defs: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);
477 CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
561 virtual llvm::Constant *BuildGCBlockLayout(CodeGenModule &CGM,
565 virtual llvm::Constant *BuildRCBlockLayout(CodeGenModule &CGM,
570 virtual llvm::Constant *BuildByrefLayout(CodeGenModule &CGM,
619 MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy, NULL);
621 MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
708 const ObjCRuntime &R = CGM.getLangOpts().ObjCRuntime;
714 SlotLookupFn.init(&CGM, "objc_msg_lookup_sender", SlotTy, PtrToIdTy,
717 SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy,
720 if (CGM.getLangOpts().CPlusPlus) {
723 EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy, NULL);
725 ExitCatchFn.init(&CGM, "__cxa_end_catch", VoidTy, NULL);
727 ExceptionReThrowFn.init(&CGM, "_Unwind_Resume_or_Rethrow", VoidTy,
732 EnterCatchFn.init(&CGM, "objc_begin_catch", IdTy, PtrTy, NULL);
734 ExitCatchFn.init(&CGM, "objc_end_catch", VoidTy, NULL);
736 ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy,
740 SetPropertyAtomic.init(&CGM, "objc_setProperty_atomic", VoidTy, IdTy,
742 SetPropertyAtomicCopy.init(&CGM, "objc_setProperty_atomic_copy", VoidTy,
744 SetPropertyNonAtomic.init(&CGM, "objc_setProperty_nonatomic", VoidTy,
746 SetPropertyNonAtomicCopy.init(&CGM, "objc_setProperty_nonatomic_copy",
750 CxxAtomicObjectSetFn.init(&CGM, "objc_setCppObjectAtomic", VoidTy, PtrTy,
754 CxxAtomicObjectGetFn.init(&CGM, "objc_getCppObjectAtomic", VoidTy, PtrTy,
760 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
767 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
776 assert ((CGM.getLangOpts().getGC() == LangOptions::NonGC));
779 assert (CGM.getLangOpts().ObjCRuntime.getVersion() >=
849 MsgLookupFn.init(&CGM, "objc_msg_lookup", IMPTy, IdTy, SelectorTy, NULL);
851 MsgLookupSuperFn.init(&CGM, "objc_msg_lookup_super", IMPTy,
886 CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
888 : CGObjCRuntime(cgm), TheModule(CGM.getModule()),
889 VMContext(cgm.getLLVMContext()), ClassPtrAlias(0), MetaClassPtrAlias(0),
894 CodeGenTypes &Types = CGM.getTypes();
896 Types.ConvertType(CGM.getContext().IntTy));
898 Types.ConvertType(CGM.getContext().LongTy));
900 Types.ConvertType(CGM.getContext().getSizeType()));
902 Types.ConvertType(CGM.getContext().getPointerDiffType()));
903 BoolTy = CGM.getTypes().ConvertType(CGM.getContext().BoolTy);
913 QualType selTy = CGM.getContext().getObjCSelType();
917 SelectorTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(selTy));
930 QualType UnqualIdTy = CGM.getContext().getObjCIdType();
933 ASTIdTy = CGM.getContext().getCanonicalType(UnqualIdTy);
934 IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
946 ExceptionThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy, NULL);
947 ExceptionReThrowFn.init(&CGM, "objc_exception_throw", VoidTy, IdTy, NULL);
949 SyncEnterFn.init(&CGM, "objc_sync_enter", IntTy, IdTy, NULL);
951 SyncExitFn.init(&CGM, "objc_sync_exit", IntTy, IdTy, NULL);
954 EnumerationMutationFn.init(&CGM, "objc_enumerationMutation", VoidTy,
958 GetPropertyFn.init(&CGM, "objc_getProperty", IdTy, IdTy, SelectorTy,
961 SetPropertyFn.init(&CGM, "objc_setProperty", VoidTy, IdTy, SelectorTy,
964 GetStructPropertyFn.init(&CGM, "objc_getPropertyStruct", VoidTy, PtrTy, PtrTy,
967 SetStructPropertyFn.init(&CGM, "objc_setPropertyStruct", VoidTy, PtrTy, PtrTy,
975 const LangOptions &Opts = CGM.getLangOpts();
985 RetainSel = GetNullarySelector("retain", CGM.getContext());
986 ReleaseSel = GetNullarySelector("release", CGM.getContext());
987 AutoreleaseSel = GetNullarySelector("autorelease", CGM.getContext());
992 IvarAssignFn.init(&CGM, "objc_assign_ivar", IdTy, IdTy, IdTy, PtrDiffTy,
995 StrongCastAssignFn.init(&CGM, "objc_assign_strongCast", IdTy, IdTy,
998 GlobalAssignFn.init(&CGM, "objc_assign_global", IdTy, IdTy, PtrToIdTy,
1001 WeakAssignFn.init(&CGM, "objc_assign_weak", IdTy, IdTy, PtrToIdTy, NULL);
1003 WeakReadFn.init(&CGM, "objc_read_weak", IdTy, PtrToIdTy, NULL);
1005 MemMoveFn.init(&CGM, "objc_memmove_collectable", PtrTy, PtrTy, PtrTy,
1013 llvm::Value *ClassName = CGM.GetAddrOfConstantCString(Name);
1026 CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, PtrToInt8Ty, true),
1079 CGM.getContext().getObjCEncodingForMethodDecl(Method, SelTypes);
1089 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
1105 if (!CGM.getLangOpts().CPlusPlus)
1115 CGM.getModule().getGlobalVariable("__objc_id_type_info");
1118 new llvm::GlobalVariable(CGM.getModule(), PtrToInt8Ty,
1177 StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
1220 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
1223 CGM.getTypes().ConvertType(ResultType)));
1245 classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
1248 classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
1323 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
1326 CGM.getTypes().ConvertType(ResultType)));
1362 IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
1391 switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
1397 if (CGM.ReturnTypeUsesFPRet(ResultType)) {
1398 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1400 } else if (CGM.ReturnTypeUsesSRet(MSI.CallInfo)) {
1403 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1406 imp = CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, IdTy, true),
1616 CGM.getContext().getCharWidth()));
1714 CGM.getTypes().ConvertType(CGM.getContext().getObjCProtoType());
1751 ASTContext &Context = CGM.getContext();
2017 CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr);
2029 CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr);
2063 ASTContext &Context = CGM.getContext();
2140 ASTContext &Context = CGM.getContext();
2184 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2197 uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
2199 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2394 StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
2511 CGM.getContext().getCharWidth()));
2514 SourceManager &SM = CGM.getContext().getSourceManager();
2522 switch (CGM.getLangOpts().getGC()) {
2527 if (CGM.getLangOpts().ObjCAutoRefCount)
2553 llvm::Value *Register = CGM.CreateRuntimeFunction(FT, "__objc_exec_class");
2609 CodeGenTypes &Types = CGM.getTypes();
2774 if (!CGM.getContext().getObjCImplementation(
2776 Offset = ComputeIvarBaseOffset(CGM, ID, Ivar);
2784 if (CGM.getLangOpts().PICLevel || CGM.getLangOpts().PIELevel) {
2830 if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
2831 Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
2849 uint64_t Offset = ComputeIvarBaseOffset(CGF.CGM, Interface, Ivar);
2854 clang::CodeGen::CreateGNUObjCRuntime(CodeGenModule &CGM) {
2855 switch (CGM.getLangOpts().ObjCRuntime.getKind()) {
2857 return new CGObjCGNUstep(CGM);
2860 return new CGObjCGCC(CGM);
2863 return new CGObjCObjFW(CGM);