Rename ScopedDecl::getContext() -> getContextDecl(). Two motivations:

#1: To be consistent with FieldDecl::getContextDecl(), which serves the same purpose.
#2: From my perspective, getContext() is too general (and used by several other classes for different purposes).

llvm-svn: 49224
This commit is contained in:
Steve Naroff 2008-04-04 18:15:49 +00:00
parent 8164ca61b1
commit c7d38433cd
3 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ protected:
: NamedDecl(DK, L, Id), NextDeclarator(PrevDecl), Next(0), CtxDecl(CD) {}
public:
ContextDecl *getContext() const { return CtxDecl; }
ContextDecl *getContextDecl() const { return CtxDecl; }
ScopedDecl *getNext() const { return Next; }
void setNext(ScopedDecl *N) { Next = N; }
@ -83,8 +83,8 @@ public:
// roughly global variables and functions, but also handles enums (which could
// be defined inside or outside a function etc).
bool isDefinedOutsideFunctionOrMethod() const {
if (getContext())
return !getContext()->isFunctionOrMethod();
if (getContextDecl())
return !getContextDecl()->isFunctionOrMethod();
else
return true;
}

View File

@ -335,7 +335,7 @@ const Attr *Decl::getAttrs() const {
ContextDecl *ContextDecl::getParent() const {
if (ScopedDecl *SD = dyn_cast<ScopedDecl>(this))
return SD->getContext();
return SD->getContextDecl();
else
return NULL;
}

View File

@ -106,7 +106,7 @@ void NamedDecl::ReadInRec(Deserializer& D) {
void ScopedDecl::EmitInRec(Serializer& S) const {
NamedDecl::EmitInRec(S);
S.EmitPtr(getNext()); // From ScopedDecl.
S.EmitPtr(cast_or_null<Decl>(getContext())); // From ScopedDecl.
S.EmitPtr(cast_or_null<Decl>(getContextDecl())); // From ScopedDecl.
}
void ScopedDecl::ReadInRec(Deserializer& D) {