]> granicus.if.org Git - clang/commitdiff
Don't omit retain / release / autorelease message sends in hybrid GC mode.
authorDavid Chisnall <csdavec@swan.ac.uk>
Mon, 23 May 2011 23:13:25 +0000 (23:13 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Mon, 23 May 2011 23:13:25 +0000 (23:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131932 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index 82a0f9b12269c0bdb8bf885759c83950d23edfb6..ff583af7cdd9855f10cfe45f37a78cc772c70e6c 100644 (file)
@@ -955,7 +955,7 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
                                     bool IsClassMessage,
                                     const CallArgList &CallArgs,
                                     const ObjCMethodDecl *Method) {
-  if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+  if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly) {
     if (Sel == RetainSel || Sel == AutoreleaseSel) {
       return RValue::get(Receiver);
     }
@@ -1063,7 +1063,7 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF,
                                const ObjCInterfaceDecl *Class,
                                const ObjCMethodDecl *Method) {
   // Strip out message sends to retain / release in GC mode
-  if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+  if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly) {
     if (Sel == RetainSel || Sel == AutoreleaseSel) {
       return RValue::get(Receiver);
     }