Bug 707352 - Remove NS_FINAL_CLASS completely. r=cjones

This commit is contained in:
Jeff Walden 2011-12-05 17:10:05 -05:00
parent adf79ecc9c
commit 3d8e7a0d23
8 changed files with 0 additions and 93 deletions

View File

@ -1,37 +0,0 @@
function process_type(c)
{
if ((c.kind == 'class' || c.kind == 'struct') && !c.isIncomplete) {
for each (let base in c.bases)
if (isFinal(base.type))
error("Class '" + c.name + "' derives from final class '" + base.type.name + "'.", c.loc);
}
}
function process_function(decl, body)
{
if (!decl.memberOf)
return;
let c = decl.memberOf;
if ((c.kind == 'class' || c.kind == 'struct') && !c.isIncomplete) {
for each (let base in ancestorTypes(c))
for each (let member in base.members)
if (member.isFunction && isFinal(member) && member.shortName == decl.shortName)
error("Function '" + decl.name + "' overrides final ancestor in '" +
base.name + "'.", c.loc);
}
}
function ancestorTypes(c)
{
for each (let base in c.bases) {
yield base.type;
for (let bb in ancestorTypes(base.type))
yield bb;
}
}
function isFinal(c)
{
return hasAttribute(c, 'NS_final');
}

View File

@ -473,7 +473,6 @@ typedef PRUint32 nsrefcnt;
* Static type annotations, enforced when static-checking is enabled:
*
* NS_STACK_CLASS: a class which must only be instantiated on the stack
* NS_FINAL_CLASS: a class which may not be subclassed
*
* NS_MUST_OVERRIDE:
* a method which every immediate subclass of this class must
@ -490,13 +489,11 @@ typedef PRUint32 nsrefcnt;
#define NS_STACK_CLASS __attribute__((user("NS_stack")))
#define NS_OKONHEAP __attribute__((user("NS_okonheap")))
#define NS_SUPPRESS_STACK_CHECK __attribute__((user("NS_suppress_stackcheck")))
#define NS_FINAL_CLASS __attribute__((user("NS_final")))
#define NS_MUST_OVERRIDE __attribute__((user("NS_must_override")))
#else
#define NS_STACK_CLASS
#define NS_OKONHEAP
#define NS_SUPPRESS_STACK_CHECK
#define NS_FINAL_CLASS
#define NS_MUST_OVERRIDE
#endif

View File

@ -431,7 +431,6 @@ nsCOMPtr_base
template <class T>
class
NS_FINAL_CLASS
NS_STACK_CLASS
nsDerivedSafe : public T
/*

View File

@ -46,13 +46,6 @@ NEED_MDDEPDIR = 1
include $(DEPTH)/config/autoconf.mk
FINAL_FAILURE_TESTCASES = \
TestFinal.cpp \
TestFinalTemplate.cpp \
TestFinalFunction.cpp \
TestFinalGrandparentFunction.cpp \
$(NULL)
STACK_FAILURE_TESTCASES = \
TestStack.cpp \
TestStackTemplate.cpp \
@ -152,7 +145,6 @@ STATIC_INIT_WARNING_TESTCASES = \
$(NULL)
STATIC_FAILURE_TESTCASES = \
$(FINAL_FAILURE_TESTCASES) \
$(FLOW_FAILURE_TESTCASES) \
$(MUST_OVERRIDE_FAILURE_TESTCASES) \
$(OVERRIDE_FAILURE_TESTCASES) \

View File

@ -1,11 +0,0 @@
#include "nscore.h"
struct NS_FINAL_CLASS A
{
int i;
};
struct B : A
{
int j;
};

View File

@ -1,9 +0,0 @@
#include "nscore.h"
class Base {
virtual void NS_FINAL final() {}
};
class Derived : public Base {
virtual void final() {}
};

View File

@ -1,12 +0,0 @@
#include "nscore.h"
class Base {
virtual void NS_FINAL final() {}
};
class Derived : public Base {
};
class VeryDerived : public Derived {
void final() {}
};

View File

@ -1,12 +0,0 @@
#include "nscore.h"
template<class T>
struct NS_FINAL_CLASS A
{
T i;
};
struct Bint : A<int>
{
int j;
};