diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-17 18:02:43 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-17 18:02:43 +0000 |
commit | e315cb3b30a0461ae501f8942f9d012bbeee3f90 (patch) | |
tree | 33aeefdc50fc77eda89d3bb8cccae3acf5cba64d /lib/CodeGen | |
parent | 648dd82196b09953c029d15679e32a799a1b1eb6 (diff) |
Revert "Added support for new property helpers (GNUstep runtime)."
This reverts commit r170344. Doesn't even compile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 76 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 13 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCRuntime.h | 9 |
4 files changed, 13 insertions, 92 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index ced5a4cb1c..deac5f6aa4 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -772,7 +772,7 @@ static void emitCPPObjectAtomicGetterCall(CodeGenFunction &CGF, args.add(RValue::get(AtomicHelperFn), CGF.getContext().VoidPtrTy); llvm::Value *copyCppAtomicObjectFn = - CGF.CGM.getObjCRuntime().GetCppAtomicObjectGetFunction(); + CGF.CGM.getObjCRuntime().GetCppAtomicObjectFunction(); CGF.EmitCall(CGF.getTypes().arrangeFreeFunctionCall(CGF.getContext().VoidTy, args, FunctionType::ExtInfo(), @@ -1007,7 +1007,7 @@ static void emitCPPObjectAtomicSetterCall(CodeGenFunction &CGF, args.add(RValue::get(AtomicHelperFn), CGF.getContext().VoidPtrTy); llvm::Value *copyCppAtomicObjectFn = - CGF.CGM.getObjCRuntime().GetCppAtomicObjectSetFunction(); + CGF.CGM.getObjCRuntime().GetCppAtomicObjectFunction(); CGF.EmitCall(CGF.getTypes().arrangeFreeFunctionCall(CGF.getContext().VoidTy, args, FunctionType::ExtInfo(), @@ -2800,7 +2800,8 @@ void CodeGenFunction::EmitExtendGCLifetime(llvm::Value *object) { } static bool hasAtomicCopyHelperAPI(const ObjCRuntime &runtime) { - return runtime.hasAtomicCopyHelper(); + // For now, only NeXT has these APIs. + return runtime.isNeXTFamily(); } /// GenerateObjCAtomicSetterCopyHelperFunction - Given a c++ object type with diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 1cd8dbf209..245c8914b1 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -492,9 +492,8 @@ public: virtual llvm::Constant *GetOptimizedPropertySetFunction(bool atomic, bool copy); virtual llvm::Constant *GetSetStructFunction(); + virtual llvm::Constant *GetCppAtomicObjectFunction(); virtual llvm::Constant *GetGetStructFunction(); - virtual llvm::Constant *GetCppAtomicObjectGetFunction(); - virtual llvm::Constant *GetCppAtomicObjectSetFunction(); virtual llvm::Constant *EnumerationMutationFunction(); virtual void EmitTryStmt(CodeGenFunction &CGF, @@ -602,20 +601,6 @@ class CGObjCGNUstep : public CGObjCGNU { /// arguments. Returns the slot for the corresponding method. Superclass /// message lookup rarely changes, so this is a good caching opportunity. LazyRuntimeFunction SlotLookupSuperFn; - /// Specialised function for setting atomic retain properties - LazyRuntimeFunction SetPropertyAtomic; - /// Specialised function for setting atomic copy properties - LazyRuntimeFunction SetPropertyAtomicCopy; - /// Specialised function for setting nonatomic retain properties - LazyRuntimeFunction SetPropertyNonAtomic; - /// Specialised function for setting nonatomic copy properties - LazyRuntimeFunction SetPropertyNonAtomicCopy; - /// Function to perform atomic copies of C++ objects with nontrivial copy - /// constructors from Objective-C ivars. - LazyRuntimeFunction CxxAtomicObjectGetFn; - /// Function to perform atomic copies of C++ objects with nontrivial copy - /// constructors to Objective-C ivars. - LazyRuntimeFunction CxxAtomicObjectSetFn; /// Type of an slot structure pointer. This is returned by the various /// lookup functions. llvm::Type *SlotTy; @@ -691,60 +676,8 @@ class CGObjCGNUstep : public CGObjCGNU { // void __cxa_end_catch(void) ExitCatchFn.init(&CGM, "__cxa_end_catch", VoidTy, NULL); // void _Unwind_Resume_or_Rethrow(void*) - ExceptionReThrowFn.init(&CGM, "_Unwind_Resume_or_Rethrow", VoidTy, - PtrTy, NULL); + ExceptionReThrowFn.init(&CGM, "_Unwind_Resume_or_Rethrow", VoidTy, PtrTy, NULL); } - llvm::Type *VoidTy = llvm::Type::getVoidTy(VMContext); - SetPropertyAtomic.init(&CGM, "objc_setProperty_atomic", VoidTy, IdTy, - SelectorTy, IdTy, PtrDiffTy, NULL); - SetPropertyAtomicCopy.init(&CGM, "objc_setProperty_atomic_copy", VoidTy, - IdTy, SelectorTy, IdTy, PtrDiffTy, NULL); - SetPropertyNonAtomic.init(&CGM, "objc_setProperty_nonatomic", VoidTy, - IdTy, SelectorTy, IdTy, PtrDiffTy, NULL); - SetPropertyNonAtomicCopy.init(&CGM, "objc_setProperty_nonatomic_copy", - VoidTy, IdTy, SelectorTy, IdTy, PtrDiffTy, NULL); - // void objc_setCppObjectAtomic(void *dest, const void *src, void - // *helper); - CxxAtomicObjectSetFn.init(&CGM, "objc_setCppObjectAtomic", VoidTy, PtrTy, - PtrTy, PtrTy, NULL); - // void objc_getCppObjectAtomic(void *dest, const void *src, void - // *helper); - CxxAtomicObjectGetFn.init(&CGM, "objc_getCppObjectAtomic", VoidTy, PtrTy, - PtrTy, PtrTy, NULL); - } - virtual llvm::Constant *GetCppAtomicObjectGetFunction() { - // The optimised functions were added in version 1.7 of the GNUstep - // runtime. - assert (CGM.getLangOpts().ObjCRuntime.getVersion() >= - VersionTuple(1, 7)); - return CxxAtomicObjectGetFn; - } - virtual llvm::Constant *GetCppAtomicObjectSetFunction() { - ObjCRuntime R = CGM.getLangOpts().ObjCRuntime; - // The optimised functions were added in version 1.7 of the GNUstep - // runtime. - if (R.getVersion() < VersionTuple(1, 7)) return 0; - return CxxAtomicObjectSetFn; - } - virtual llvm::Constant *GetOptimizedPropertySetFunction(bool atomic, - bool copy) { - // The optimised property functions omit the GC check, and so are not - // safe to use in GC mode. The standard functions are fast in GC mode, - // so there is less advantage in using them. - assert ((CGM.getLangOpts().getGC() == LangOptions::NonGC)) return 0; - // The optimised functions were added in version 1.7 of the GNUstep - // runtime. - assert (CGM.getLangOpts().ObjCRuntime.getVersion() >= - VersionTuple(1, 7)); - - if (atomic) { - if (copy) return SetPropertyAtomicCopy; - return SetPropertyAtomic; - } - if (copy) return SetPropertyNonAtomicCopy; - return SetPropertyNonAtomic; - - return 0; } }; @@ -2602,10 +2535,7 @@ llvm::Constant *CGObjCGNU::GetGetStructFunction() { llvm::Constant *CGObjCGNU::GetSetStructFunction() { return SetStructPropertyFn; } -llvm::Constant *CGObjCGNU::GetCppAtomicObjectGetFunction() { - return 0; -} -llvm::Constant *CGObjCGNU::GetCppAtomicObjectSetFunction() { +llvm::Constant *CGObjCGNU::GetCppAtomicObjectFunction() { return 0; } diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index aff804cd4b..d84875bfd5 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -1223,8 +1223,7 @@ public: bool copy); virtual llvm::Constant *GetGetStructFunction(); virtual llvm::Constant *GetSetStructFunction(); - virtual llvm::Constant *GetCppAtomicObjectGetFunction(); - virtual llvm::Constant *GetCppAtomicObjectSetFunction(); + virtual llvm::Constant *GetCppAtomicObjectFunction(); virtual llvm::Constant *EnumerationMutationFunction(); virtual void EmitTryStmt(CodeGen::CodeGenFunction &CGF, @@ -1495,10 +1494,7 @@ public: virtual llvm::Constant *GetGetStructFunction() { return ObjCTypes.getCopyStructFn(); } - virtual llvm::Constant *GetCppAtomicObjectSetFunction() { - return ObjCTypes.getCppAtomicObjectFunction(); - } - virtual llvm::Constant *GetCppAtomicObjectGetFunction() { + virtual llvm::Constant *GetCppAtomicObjectFunction() { return ObjCTypes.getCppAtomicObjectFunction(); } @@ -3413,10 +3409,7 @@ llvm::Constant *CGObjCMac::GetSetStructFunction() { return ObjCTypes.getCopyStructFn(); } -llvm::Constant *CGObjCMac::GetCppAtomicObjectGetFunction() { - return ObjCTypes.getCppAtomicObjectFunction(); -} -llvm::Constant *CGObjCMac::GetCppAtomicObjectSetFunction() { +llvm::Constant *CGObjCMac::GetCppAtomicObjectFunction() { return ObjCTypes.getCppAtomicObjectFunction(); } diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h index 584bf6738f..934464b9e5 100644 --- a/lib/CodeGen/CGObjCRuntime.h +++ b/lib/CodeGen/CGObjCRuntime.h @@ -209,12 +209,9 @@ public: virtual llvm::Constant *GetGetStructFunction() = 0; // API for atomic copying of qualified aggregates in setter. virtual llvm::Constant *GetSetStructFunction() = 0; - /// API for atomic copying of qualified aggregates with non-trivial copy - /// assignment (c++) in setter. - virtual llvm::Constant *GetCppAtomicObjectSetFunction() = 0; - /// API for atomic copying of qualified aggregates with non-trivial copy - /// assignment (c++) in getter. - virtual llvm::Constant *GetCppAtomicObjectGetFunction() = 0; + // API for atomic copying of qualified aggregates with non-trivial copy + // assignment (c++) in setter/getter. + virtual llvm::Constant *GetCppAtomicObjectFunction() = 0; /// GetClass - Return a reference to the class for the given /// interface decl. |