[cfe-commits] r123095 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp
Sean Hunt
scshunt at csclub.uwaterloo.ca
Sat Jan 8 15:01:16 PST 2011
Author: coppro
Date: Sat Jan 8 17:01:16 2011
New Revision: 123095
URL: http://llvm.org/viewvc/llvm-project?rev=123095&view=rev
Log:
Rename CXXCtorInitializer::BaseOrMember to Initializee, since it will also be
used to store the CXXConstructorDecl in a delegating constructor.
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/AST/DeclCXX.cpp
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=123095&r1=123094&r2=123095&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Sat Jan 8 17:01:16 2011
@@ -1124,8 +1124,8 @@
/// \brief Either the base class name (stored as a TypeSourceInfo*), an normal
/// field (FieldDecl) or an anonymous field (IndirectFieldDecl*) being
/// initialized.
- llvm::PointerUnion3<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
- BaseOrMember;
+ llvm::PointerUnion3<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
+ Initializee;
/// \brief The source location for the field name or, for a base initializer
/// pack expansion, the location of the ellipsis.
@@ -1187,18 +1187,18 @@
/// isBaseInitializer - Returns true when this initializer is
/// initializing a base class.
- bool isBaseInitializer() const { return BaseOrMember.is<TypeSourceInfo*>(); }
+ bool isBaseInitializer() const { return Initializee.is<TypeSourceInfo*>(); }
/// isMemberInitializer - Returns true when this initializer is
/// initializing a non-static data member.
- bool isMemberInitializer() const { return BaseOrMember.is<FieldDecl*>(); }
+ bool isMemberInitializer() const { return Initializee.is<FieldDecl*>(); }
bool isAnyMemberInitializer() const {
return isMemberInitializer() || isIndirectMemberInitializer();
}
bool isIndirectMemberInitializer() const {
- return BaseOrMember.is<IndirectFieldDecl*>();
+ return Initializee.is<IndirectFieldDecl*>();
}
/// \brief Determine whether this initializer is a pack expansion.
@@ -1231,7 +1231,7 @@
/// \brief Returns the declarator information for a base class initializer.
TypeSourceInfo *getBaseClassInfo() const {
- return BaseOrMember.dyn_cast<TypeSourceInfo *>();
+ return Initializee.dyn_cast<TypeSourceInfo *>();
}
/// getMember - If this is a member initializer, returns the
@@ -1239,22 +1239,22 @@
/// initialized. Otherwise, returns NULL.
FieldDecl *getMember() const {
if (isMemberInitializer())
- return BaseOrMember.get<FieldDecl*>();
+ return Initializee.get<FieldDecl*>();
else
return 0;
}
FieldDecl *getAnyMember() const {
if (isMemberInitializer())
- return BaseOrMember.get<FieldDecl*>();
+ return Initializee.get<FieldDecl*>();
else if (isIndirectMemberInitializer())
- return BaseOrMember.get<IndirectFieldDecl*>()->getAnonField();
+ return Initializee.get<IndirectFieldDecl*>()->getAnonField();
else
return 0;
}
IndirectFieldDecl *getIndirectMember() const {
if (isIndirectMemberInitializer())
- return BaseOrMember.get<IndirectFieldDecl*>();
+ return Initializee.get<IndirectFieldDecl*>();
else
return 0;
}
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=123095&r1=123094&r2=123095&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Sat Jan 8 17:01:16 2011
@@ -1004,7 +1004,7 @@
SourceLocation L, Expr *Init,
SourceLocation R,
SourceLocation EllipsisLoc)
- : BaseOrMember(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init),
+ : Initializee(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init),
LParenLoc(L), RParenLoc(R), IsVirtual(IsVirtual), IsWritten(false),
SourceOrderOrNumArrayIndices(0)
{
@@ -1015,7 +1015,7 @@
SourceLocation MemberLoc,
SourceLocation L, Expr *Init,
SourceLocation R)
- : BaseOrMember(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
+ : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
LParenLoc(L), RParenLoc(R), IsVirtual(false),
IsWritten(false), SourceOrderOrNumArrayIndices(0)
{
@@ -1026,7 +1026,7 @@
SourceLocation MemberLoc,
SourceLocation L, Expr *Init,
SourceLocation R)
- : BaseOrMember(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
+ : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
LParenLoc(L), RParenLoc(R), IsVirtual(false),
IsWritten(false), SourceOrderOrNumArrayIndices(0)
{
@@ -1039,7 +1039,7 @@
SourceLocation R,
VarDecl **Indices,
unsigned NumIndices)
- : BaseOrMember(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
+ : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
LParenLoc(L), RParenLoc(R), IsVirtual(false),
IsWritten(false), SourceOrderOrNumArrayIndices(NumIndices)
{
@@ -1057,27 +1057,27 @@
void *Mem = Context.Allocate(sizeof(CXXCtorInitializer) +
sizeof(VarDecl *) * NumIndices,
llvm::alignOf<CXXCtorInitializer>());
- return new (Mem) CXXCtorInitializer(Context, Member, MemberLoc,
- L, Init, R, Indices, NumIndices);
+ return new (Mem) CXXCtorInitializer(Context, Member, MemberLoc, L, Init, R,
+ Indices, NumIndices);
}
TypeLoc CXXCtorInitializer::getBaseClassLoc() const {
if (isBaseInitializer())
- return BaseOrMember.get<TypeSourceInfo*>()->getTypeLoc();
+ return Initializee.get<TypeSourceInfo*>()->getTypeLoc();
else
return TypeLoc();
}
Type *CXXCtorInitializer::getBaseClass() {
if (isBaseInitializer())
- return BaseOrMember.get<TypeSourceInfo*>()->getType().getTypePtr();
+ return Initializee.get<TypeSourceInfo*>()->getType().getTypePtr();
else
return 0;
}
const Type *CXXCtorInitializer::getBaseClass() const {
if (isBaseInitializer())
- return BaseOrMember.get<TypeSourceInfo*>()->getType().getTypePtr();
+ return Initializee.get<TypeSourceInfo*>()->getType().getTypePtr();
else
return 0;
}
More information about the cfe-commits
mailing list