Commit e6afe6bb authored by weinig@apple.com's avatar weinig@apple.com

2009-04-15 Sam Weinig <sam@webkit.org>

        Reviewed by Anders Carlsson.

        Remove support for the ObjCIvar extended attribute from the Objective-C
        bindings generator.  It is not used anymore.

        * bindings/scripts/CodeGeneratorObjC.pm:



git-svn-id: svn://svn.chromium.org/blink/trunk@42551 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7a925594
2009-04-15 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Remove support for the ObjCIvar extended attribute from the Objective-C
bindings generator. It is not used anymore.
* bindings/scripts/CodeGeneratorObjC.pm:
2009-04-15 Justin Garcia <justin.garcia@apple.com> 2009-04-15 Justin Garcia <justin.garcia@apple.com>
Reviewed by Dan Bernstein. Reviewed by Dan Bernstein.
...@@ -33,7 +33,6 @@ my $newPublicClass = 0; ...@@ -33,7 +33,6 @@ my $newPublicClass = 0;
my $interfaceAvailabilityVersion = ""; my $interfaceAvailabilityVersion = "";
my $isProtocol = 0; my $isProtocol = 0;
my $noImpl = 0; my $noImpl = 0;
my @ivars = ();
my @headerContentHeader = (); my @headerContentHeader = ();
my @headerContent = (); my @headerContent = ();
...@@ -542,30 +541,9 @@ sub GetInternalTypeMakerSignature ...@@ -542,30 +541,9 @@ sub GetInternalTypeMakerSignature
if ($podType) { if ($podType) {
$podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType"; $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";
} }
my @ivarsToRetain = ();
my $ivarsToInit = "";
my $typeMakerSigAddition = "";
if (@ivars > 0) {
my @ivarsInitSig = ();
my @ivarsInitCall = ();
foreach $attribute (@ivars) {
my $name = $attribute->signature->name;
my $memberName = "m_" . $name;
my $varName = "in" . $name;
my $type = GetObjCType($attribute->signature->type);
push(@ivarsInitSig, "$name:($type)$varName");
push(@ivarsInitCall, "$name:$varName");
push(@ivarsToRetain, " $memberName = [$varName retain];\n");
}
$ivarsToInit = " " . join(" ", @ivarsInitCall);
$typeMakerSigAddition = " " . join(" ", @ivarsInitSig);
}
my $typeMakerName = GetObjCTypeMaker($interfaceName); my $typeMakerName = GetObjCTypeMaker($interfaceName);
return ("+ ($className *)$typeMakerName:(" . ($podType ? "$podTypeWithNamespace" : "$implClassNameWithNamespace *") . ")impl" . $typeMakerSigAddition, return "+ ($className *)$typeMakerName:(" . ($podType ? "$podTypeWithNamespace" : "$implClassNameWithNamespace *") . ")impl";
$typeMakerSigAddition,
$ivarsToInit);
} }
sub AddForwardDeclarationsForType sub AddForwardDeclarationsForType
...@@ -758,23 +736,6 @@ sub GenerateHeader ...@@ -758,23 +736,6 @@ sub GenerateHeader
# - Add attribute getters/setters. # - Add attribute getters/setters.
if ($numAttributes > 0) { if ($numAttributes > 0) {
# Add ivars, if any, first
@ivars = ();
foreach my $attribute (@{$dataNode->attributes}) {
push(@ivars, $attribute) if $attribute->signature->extendedAttributes->{"ObjCIvar"};
}
if (@ivars > 0) {
push(@headerContent, "{\n");
foreach my $attribute (@ivars) {
my $type = GetObjCType($attribute->signature->type);
my $name = "m_" . $attribute->signature->name;
my $ivarDeclaration = "$type $name";
push(@headerContent, " $ivarDeclaration;\n");
}
push(@headerContent, "}\n");
}
foreach my $attribute (@{$dataNode->attributes}) { foreach my $attribute (@{$dataNode->attributes}) {
my $attributeName = $attribute->signature->name; my $attributeName = $attribute->signature->name;
...@@ -991,7 +952,7 @@ sub GenerateHeader ...@@ -991,7 +952,7 @@ sub GenerateHeader
# Generate internal interfaces # Generate internal interfaces
my $podType = $dataNode->extendedAttributes->{"PODType"}; my $podType = $dataNode->extendedAttributes->{"PODType"};
my $typeGetterSig = GetInternalTypeGetterSignature($interfaceName, $podType); my $typeGetterSig = GetInternalTypeGetterSignature($interfaceName, $podType);
my ($typeMakerSig, $typeMakerSigAddition, $ivarsToInit) = GetInternalTypeMakerSignature($interfaceName, $podType); my $typeMakerSig = GetInternalTypeMakerSignature($interfaceName, $podType);
# Generate interface definitions. # Generate interface definitions.
@internalHeaderContent = split("\r", $implementationLicenceTemplate); @internalHeaderContent = split("\r", $implementationLicenceTemplate);
...@@ -1110,18 +1071,9 @@ sub GenerateImplementation ...@@ -1110,18 +1071,9 @@ sub GenerateImplementation
# Only generate 'dealloc' and 'finalize' methods for direct subclasses of DOMObject. # Only generate 'dealloc' and 'finalize' methods for direct subclasses of DOMObject.
if ($parentImplClassName eq "Object") { if ($parentImplClassName eq "Object") {
my @ivarsToRelease = ();
if (@ivars > 0) {
foreach $attribute (@ivars) {
my $name = "m_" . $attribute->signature->name;
push(@ivarsToRelease, " [$name release];\n");
}
}
push(@implContent, "- (void)dealloc\n"); push(@implContent, "- (void)dealloc\n");
push(@implContent, "{\n"); push(@implContent, "{\n");
push(@implContent, " $assertMainThread\n"); push(@implContent, " $assertMainThread\n");
push(@implContent, @ivarsToRelease);
if ($interfaceName eq "NodeIterator") { if ($interfaceName eq "NodeIterator") {
push(@implContent, " if (_internal) {\n"); push(@implContent, " if (_internal) {\n");
push(@implContent, " [self detach];\n"); push(@implContent, " [self detach];\n");
...@@ -1559,12 +1511,12 @@ sub GenerateImplementation ...@@ -1559,12 +1511,12 @@ sub GenerateImplementation
push(@implContent, "}\n\n"); push(@implContent, "}\n\n");
my ($typeMakerSig, $typeMakerSigAddition, $ivarsToInit) = GetInternalTypeMakerSignature($interfaceName, $podType); my $typeMakerSig = GetInternalTypeMakerSignature($interfaceName, $podType);
if ($podType) { if ($podType) {
# - (id)_initWithFooBar:(WebCore::FooBar)impl for implementation class FooBar # - (id)_initWithFooBar:(WebCore::FooBar)impl for implementation class FooBar
my $initWithImplName = "_initWith" . $implClassName; my $initWithImplName = "_initWith" . $implClassName;
my $initWithSig = "- (id)$initWithImplName:($podTypeWithNamespace)impl" . $typeMakerSigAddition; my $initWithSig = "- (id)$initWithImplName:($podTypeWithNamespace)impl";
# FIXME: Implement Caching # FIXME: Implement Caching
push(@implContent, "$initWithSig\n"); push(@implContent, "$initWithSig\n");
...@@ -1585,7 +1537,7 @@ sub GenerateImplementation ...@@ -1585,7 +1537,7 @@ sub GenerateImplementation
} elsif ($parentImplClassName eq "Object") { } elsif ($parentImplClassName eq "Object") {
# - (id)_initWithFooBar:(WebCore::FooBar *)impl for implementation class FooBar # - (id)_initWithFooBar:(WebCore::FooBar *)impl for implementation class FooBar
my $initWithImplName = "_initWith" . $implClassName; my $initWithImplName = "_initWith" . $implClassName;
my $initWithSig = "- (id)$initWithImplName:($implClassNameWithNamespace *)impl" . $typeMakerSigAddition; my $initWithSig = "- (id)$initWithImplName:($implClassNameWithNamespace *)impl";
push(@implContent, "$initWithSig\n"); push(@implContent, "$initWithSig\n");
push(@implContent, "{\n"); push(@implContent, "{\n");
...@@ -1594,7 +1546,6 @@ sub GenerateImplementation ...@@ -1594,7 +1546,6 @@ sub GenerateImplementation
push(@implContent, " _internal = reinterpret_cast<DOMObjectInternal*>(impl);\n"); push(@implContent, " _internal = reinterpret_cast<DOMObjectInternal*>(impl);\n");
push(@implContent, " impl->ref();\n"); push(@implContent, " impl->ref();\n");
push(@implContent, " WebCore::addDOMWrapper(self, impl);\n"); push(@implContent, " WebCore::addDOMWrapper(self, impl);\n");
push(@implContent, @ivarsToRetain);
push(@implContent, " return self;\n"); push(@implContent, " return self;\n");
push(@implContent, "}\n\n"); push(@implContent, "}\n\n");
...@@ -1608,7 +1559,7 @@ sub GenerateImplementation ...@@ -1608,7 +1559,7 @@ sub GenerateImplementation
push(@implContent, " cachedInstance = WebCore::getDOMWrapper(impl);\n"); push(@implContent, " cachedInstance = WebCore::getDOMWrapper(impl);\n");
push(@implContent, " if (cachedInstance)\n"); push(@implContent, " if (cachedInstance)\n");
push(@implContent, " return [[cachedInstance retain] autorelease];\n"); push(@implContent, " return [[cachedInstance retain] autorelease];\n");
push(@implContent, " return [[[self alloc] $initWithImplName:impl" . $ivarsToInit . "] autorelease];\n"); push(@implContent, " return [[[self alloc] $initWithImplName:impl] autorelease];\n");
push(@implContent, "}\n\n"); push(@implContent, "}\n\n");
} else { } else {
my $internalBaseType = "DOM$baseClass"; my $internalBaseType = "DOM$baseClass";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment