Bug 125170 - [iOS] Enable Objective-C ARC when building JSC tools for iOS Simulator
Summary: [iOS] Enable Objective-C ARC when building JSC tools for iOS Simulator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 11:21 PST by Daniel Bates
Modified: 2013-12-04 15:04 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.53 KB, patch)
2013-12-03 11:23 PST, Daniel Bates
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2013-12-03 11:21:12 PST
When compiling testapi.mm for i386 to run with the iOS Simulator I got build errors of the form:

.../Source/JavaScriptCore/API/tests/testapi.mm:158:1: error: method possibly missing a [super dealloc] call [-Werror,-Wobjc-missing-super-calls]
}

In particular, Clang is complaining that we're missing a call to [super dealloc] in [-TextXYZ  dealloc] and [EvilAllocationObject dealloc]:
<http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/API/tests/testapi.mm?rev=159351#L172>
<http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/API/tests/testapi.mm?rev=159351#L440>
Comment 1 Daniel Bates 2013-12-03 11:23:13 PST
Created attachment 218314 [details]
Patch
Comment 2 Geoffrey Garen 2013-12-03 12:05:22 PST
Comment on attachment 218314 [details]
Patch

r=me
Comment 3 Mark Rowe (bdash) 2013-12-03 23:08:33 PST
Comment on attachment 218314 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218314&action=review

> Source/JavaScriptCore/ChangeLog:10
> +        (-[EvilAllocationObject dealloc]): Add call to [super dealloc] when building without ARC
> +        (say, on a 32-bit Mac using Objective-C ABI < 2).

What's the motivation for this change? The code in question is never compiled in 32-bit since it's wrapped in #if JSC_OBJC_API_ENABLED.
Comment 4 Daniel Bates 2013-12-04 11:50:40 PST
(In reply to comment #3)
> (From update of attachment 218314 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=218314&action=review
> 
> > Source/JavaScriptCore/ChangeLog:10
> > +        (-[EvilAllocationObject dealloc]): Add call to [super dealloc] when building without ARC
> > +        (say, on a 32-bit Mac using Objective-C ABI < 2).
> 
> What's the motivation for this change? The code in question is never compiled in 32-bit since it's wrapped in #if JSC_OBJC_API_ENABLED.

The added calls to [super dealloc] are unnecessary and I will remove them before landing this patch. We should also look to remove the existing !__has_feature(objc_arc)-guarded code from file Source/JavaScriptCore/API/tests/testapi.mm.

Additional remarks:

The change log comment about adding [super dealloc] is misleading. What I meant to write was:

(-[EvilAllocationObject dealloc]): Added call to [super dealloc] when building without ARC (say, when explicitly setting CLANG_ENABLE_OBJC_ARC_i386_iphonesimulator to NO and building for iOS Simulator on a 32-bit Mac using Objective-C ABI < 2).

For some reason I thought to support building without ARC for 32-bit iOS Simulator builds, including older versions of the iOS Simulator, say version < 4.0. It's unnecessary to support such older versions of iOS Simulator.
Comment 5 Daniel Bates 2013-12-04 15:04:21 PST
Committed r160131: <http://trac.webkit.org/changeset/160131>