Use Prototype instead of Function.

This commit is contained in:
Roberto Raggi
2010-08-05 17:06:16 +02:00
committed by Oswald Buddenhagen
parent 9aa991d636
commit 4ff3ee2ff0
11 changed files with 20 additions and 28 deletions

View File

@@ -118,7 +118,7 @@ Scope *Scope::enclosingEnumScope() const
return scope;
}
Scope *Scope::enclosingFunctionScope() const
Scope *Scope::enclosingPrototypeScope() const
{
Scope *scope = enclosingScope();
for (; scope; scope = scope->enclosingScope()) {
@@ -166,11 +166,6 @@ bool Scope::isBlockScope() const
return false;
}
bool Scope::isPrototypeScope() const
{
return isFunctionScope();
}
bool Scope::isObjCClassScope() const
{
if (_owner)
@@ -185,7 +180,7 @@ bool Scope::isObjCProtocolScope() const
return false;
}
bool Scope::isFunctionScope() const
bool Scope::isPrototypeScope() const
{
if (_owner)
return _owner->isFunction();

View File

@@ -87,8 +87,8 @@ public:
/// Returns the enclosing enum scope.
Scope *enclosingEnumScope() const;
/// Rerturns the enclosing function scope.
Scope *enclosingFunctionScope() const;
/// Rerturns the enclosing prototype scope.
Scope *enclosingPrototypeScope() const;
/// Rerturns the enclosing Block scope.
Scope *enclosingBlockScope() const;
@@ -105,9 +105,6 @@ public:
/// Returns true if this scope's owner is a Block Symbol.
bool isBlockScope() const;
/// Returns true if this scope's owner is a Function Symbol.
bool isFunctionScope() const;
/// Returns true if this scope's owner is a Prototype Symbol.
bool isPrototypeScope() const;

View File

@@ -283,15 +283,15 @@ Scope *Symbol::enclosingEnumScope() const
return _scope->enclosingEnumScope();
}
Scope *Symbol::enclosingFunctionScope() const
Scope *Symbol::enclosingPrototypeScope() const
{
if (! _scope)
return 0;
else if (_scope->isFunctionScope())
else if (_scope->isPrototypeScope())
return _scope;
return _scope->enclosingFunctionScope();
return _scope->enclosingPrototypeScope();
}
Scope *Symbol::enclosingBlockScope() const

View File

@@ -295,8 +295,8 @@ public:
/// Returns the enclosing enum scope.
Scope *enclosingEnumScope() const;
/// Returns the enclosing function scope.
Scope *enclosingFunctionScope() const;
/// Returns the enclosing prototype scope.
Scope *enclosingPrototypeScope() const;
/// Returns the enclosing Block scope.
Scope *enclosingBlockScope() const;