kill dead code
When trying to figure out what this was I figured out it wasn't anything.
Esse commit está contido em:
@@ -61,8 +61,7 @@ ClassScope::ClassScope(KindOf kindOf, const std::string &name,
|
||||
m_kindOf(kindOf), m_derivesFromRedeclaring(FromNormal),
|
||||
m_traitStatus(NOT_FLATTENED), m_volatile(false),
|
||||
m_persistent(false), m_derivedByDynamic(false),
|
||||
m_sep(false), m_needsCppCtor(false), m_needsInit(true), m_knownBases(0),
|
||||
m_needsEnableDestructor(0) {
|
||||
m_sep(false), m_needsCppCtor(false), m_needsInit(true), m_knownBases(0) {
|
||||
|
||||
m_dynamic = Option::IsDynamicClass(m_name);
|
||||
|
||||
@@ -93,7 +92,7 @@ ClassScope::ClassScope(AnalysisResultPtr ar,
|
||||
m_traitStatus(NOT_FLATTENED), m_dynamic(false),
|
||||
m_volatile(false), m_persistent(false),
|
||||
m_derivedByDynamic(false), m_sep(false), m_needsCppCtor(false),
|
||||
m_needsInit(true), m_knownBases(0), m_needsEnableDestructor(0) {
|
||||
m_needsInit(true), m_knownBases(0) {
|
||||
BOOST_FOREACH(FunctionScopePtr f, methods) {
|
||||
if (f->getName() == "__construct") setAttribute(HasConstructor);
|
||||
else if (f->getName() == "__destruct") setAttribute(HasDestructor);
|
||||
@@ -1431,36 +1430,6 @@ bool ClassScope::addFunction(AnalysisResultConstPtr ar,
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* A class without a constructor, but with a destructor may need a special
|
||||
* create method to clear the NoDestructor flag - but only if
|
||||
* there is a constructor somewhere above us, and if /that/ constructor
|
||||
* doesnt need to clear the NoDestructor flag.
|
||||
*/
|
||||
bool ClassScope::needsEnableDestructor(
|
||||
AnalysisResultConstPtr ar) const {
|
||||
if (m_needsEnableDestructor & 2) {
|
||||
return m_needsEnableDestructor & 1;
|
||||
}
|
||||
bool ret =
|
||||
(!derivesFromRedeclaring() &&
|
||||
!getAttribute(HasConstructor) &&
|
||||
!getAttribute(ClassNameConstructor));
|
||||
|
||||
if (ret) {
|
||||
if (!getAttribute(HasDestructor) && !m_parent.empty()) {
|
||||
if (ClassScopePtr parent = getParentScope(ar)) {
|
||||
if (!parent->needsEnableDestructor(ar)) {
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_needsEnableDestructor = ret ? 3 : 2;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ClassScope::canSkipCreateMethod(AnalysisResultConstPtr ar) const {
|
||||
// create() is not necessary if
|
||||
// 1) not inheriting from any class
|
||||
|
||||
@@ -370,7 +370,6 @@ public:
|
||||
return m_needsInit;
|
||||
}
|
||||
|
||||
bool needsEnableDestructor(AnalysisResultConstPtr ar) const;
|
||||
bool canSkipCreateMethod(AnalysisResultConstPtr ar) const;
|
||||
bool checkHasPropTable(AnalysisResultConstPtr ar);
|
||||
|
||||
@@ -433,7 +432,6 @@ private:
|
||||
// for classes with more than 31 bases, bit 31 is set iff
|
||||
// bases 32 through n are all known.
|
||||
unsigned m_knownBases;
|
||||
mutable unsigned m_needsEnableDestructor:2;
|
||||
|
||||
void addImportTraitMethod(const TraitMethod &traitMethod,
|
||||
const std::string &methName);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário