Skip to content

Commit bcd0350

Browse files
committed
DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
1 parent 24a6316 commit bcd0350

39 files changed

+382
-382
lines changed

clang/include/clang/AST/ASTContext.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,9 @@ class ASTContext {
11171117
void setObjCImplementation(ObjCCategoryDecl *CatD,
11181118
ObjCCategoryImplDecl *ImplD);
11191119

1120-
/// \brief Allocate an uninitialized DeclaratorInfo.
1120+
/// \brief Allocate an uninitialized TypeSourceInfo.
11211121
///
1122-
/// The caller should initialize the memory held by DeclaratorInfo using
1122+
/// The caller should initialize the memory held by TypeSourceInfo using
11231123
/// the TypeLoc wrappers.
11241124
///
11251125
/// \param T the type that will be the basis for type source info. This type
@@ -1128,13 +1128,13 @@ class ASTContext {
11281128
///
11291129
/// \param Size the size of the type info to create, or 0 if the size
11301130
/// should be calculated based on the type.
1131-
DeclaratorInfo *CreateDeclaratorInfo(QualType T, unsigned Size = 0);
1131+
TypeSourceInfo *CreateTypeSourceInfo(QualType T, unsigned Size = 0);
11321132

1133-
/// \brief Allocate a DeclaratorInfo where all locations have been
1133+
/// \brief Allocate a TypeSourceInfo where all locations have been
11341134
/// initialized to a given location, which defaults to the empty
11351135
/// location.
1136-
DeclaratorInfo *
1137-
getTrivialDeclaratorInfo(QualType T, SourceLocation Loc = SourceLocation());
1136+
TypeSourceInfo *
1137+
getTrivialTypeSourceInfo(QualType T, SourceLocation Loc = SourceLocation());
11381138

11391139
private:
11401140
ASTContext(const ASTContext&); // DO NOT IMPLEMENT

clang/include/clang/AST/Decl.h

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ class TypeLoc;
3535
///
3636
/// A client can read the relevant info using TypeLoc wrappers, e.g:
3737
/// @code
38-
/// TypeLoc TL = DeclaratorInfo->getTypeLoc();
38+
/// TypeLoc TL = TypeSourceInfo->getTypeLoc();
3939
/// if (PointerLoc *PL = dyn_cast<PointerLoc>(&TL))
4040
/// PL->getStarLoc().print(OS, SrcMgr);
4141
/// @endcode
4242
///
43-
class DeclaratorInfo {
43+
class TypeSourceInfo {
4444
QualType Ty;
4545
// Contains a memory block after the class, used for type source information,
4646
// allocated by ASTContext.
4747
friend class ASTContext;
48-
DeclaratorInfo(QualType ty) : Ty(ty) { }
48+
TypeSourceInfo(QualType ty) : Ty(ty) { }
4949
public:
5050
/// \brief Return the type wrapped by this type source info.
5151
QualType getType() const { return Ty; }
@@ -322,18 +322,18 @@ class ValueDecl : public NamedDecl {
322322
};
323323

324324
/// \brief Represents a ValueDecl that came out of a declarator.
325-
/// Contains type source information through DeclaratorInfo.
325+
/// Contains type source information through TypeSourceInfo.
326326
class DeclaratorDecl : public ValueDecl {
327-
DeclaratorInfo *DeclInfo;
327+
TypeSourceInfo *DeclInfo;
328328

329329
protected:
330330
DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L,
331-
DeclarationName N, QualType T, DeclaratorInfo *DInfo)
332-
: ValueDecl(DK, DC, L, N, T), DeclInfo(DInfo) {}
331+
DeclarationName N, QualType T, TypeSourceInfo *TInfo)
332+
: ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo) {}
333333

334334
public:
335-
DeclaratorInfo *getDeclaratorInfo() const { return DeclInfo; }
336-
void setDeclaratorInfo(DeclaratorInfo *DInfo) { DeclInfo = DInfo; }
335+
TypeSourceInfo *getTypeSourceInfo() const { return DeclInfo; }
336+
void setTypeSourceInfo(TypeSourceInfo *TInfo) { DeclInfo = TInfo; }
337337

338338
SourceLocation getTypeSpecStartLoc() const;
339339

@@ -440,8 +440,8 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
440440
friend class StmtIteratorBase;
441441
protected:
442442
VarDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
443-
QualType T, DeclaratorInfo *DInfo, StorageClass SC)
444-
: DeclaratorDecl(DK, DC, L, Id, T, DInfo), Init(),
443+
QualType T, TypeSourceInfo *TInfo, StorageClass SC)
444+
: DeclaratorDecl(DK, DC, L, Id, T, TInfo), Init(),
445445
ThreadSpecified(false), HasCXXDirectInit(false),
446446
DeclaredInCondition(false) {
447447
SClass = SC;
@@ -461,7 +461,7 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
461461

462462
static VarDecl *Create(ASTContext &C, DeclContext *DC,
463463
SourceLocation L, IdentifierInfo *Id,
464-
QualType T, DeclaratorInfo *DInfo, StorageClass S);
464+
QualType T, TypeSourceInfo *TInfo, StorageClass S);
465465

466466
virtual ~VarDecl();
467467
virtual void Destroy(ASTContext& C);
@@ -752,7 +752,7 @@ class ImplicitParamDecl : public VarDecl {
752752
protected:
753753
ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L,
754754
IdentifierInfo *Id, QualType Tw)
755-
: VarDecl(DK, DC, L, Id, Tw, /*DInfo=*/0, VarDecl::None) {}
755+
: VarDecl(DK, DC, L, Id, Tw, /*TInfo=*/0, VarDecl::None) {}
756756
public:
757757
static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
758758
SourceLocation L, IdentifierInfo *Id,
@@ -779,16 +779,16 @@ class ParmVarDecl : public VarDecl {
779779

780780
protected:
781781
ParmVarDecl(Kind DK, DeclContext *DC, SourceLocation L,
782-
IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
782+
IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo,
783783
StorageClass S, Expr *DefArg)
784-
: VarDecl(DK, DC, L, Id, T, DInfo, S), objcDeclQualifier(OBJC_TQ_None) {
784+
: VarDecl(DK, DC, L, Id, T, TInfo, S), objcDeclQualifier(OBJC_TQ_None) {
785785
setDefaultArg(DefArg);
786786
}
787787

788788
public:
789789
static ParmVarDecl *Create(ASTContext &C, DeclContext *DC,
790790
SourceLocation L,IdentifierInfo *Id,
791-
QualType T, DeclaratorInfo *DInfo,
791+
QualType T, TypeSourceInfo *TInfo,
792792
StorageClass S, Expr *DefArg);
793793

794794
ObjCDeclQualifier getObjCDeclQualifier() const {
@@ -862,8 +862,8 @@ class ParmVarDecl : public VarDecl {
862862
}
863863

864864
QualType getOriginalType() const {
865-
if (getDeclaratorInfo())
866-
return getDeclaratorInfo()->getType();
865+
if (getTypeSourceInfo())
866+
return getTypeSourceInfo()->getType();
867867
return getType();
868868
}
869869

@@ -947,9 +947,9 @@ class FunctionDecl : public DeclaratorDecl, public DeclContext,
947947

948948
protected:
949949
FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L,
950-
DeclarationName N, QualType T, DeclaratorInfo *DInfo,
950+
DeclarationName N, QualType T, TypeSourceInfo *TInfo,
951951
StorageClass S, bool isInline)
952-
: DeclaratorDecl(DK, DC, L, N, T, DInfo),
952+
: DeclaratorDecl(DK, DC, L, N, T, TInfo),
953953
DeclContext(DK),
954954
ParamInfo(0), Body(),
955955
SClass(S), IsInline(isInline),
@@ -976,7 +976,7 @@ class FunctionDecl : public DeclaratorDecl, public DeclContext,
976976

977977
static FunctionDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
978978
DeclarationName N, QualType T,
979-
DeclaratorInfo *DInfo,
979+
TypeSourceInfo *TInfo,
980980
StorageClass S = None, bool isInline = false,
981981
bool hasWrittenPrototype = true);
982982

@@ -1312,15 +1312,15 @@ class FieldDecl : public DeclaratorDecl {
13121312
Expr *BitWidth;
13131313
protected:
13141314
FieldDecl(Kind DK, DeclContext *DC, SourceLocation L,
1315-
IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
1315+
IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo,
13161316
Expr *BW, bool Mutable)
1317-
: DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW) {
1317+
: DeclaratorDecl(DK, DC, L, Id, T, TInfo), Mutable(Mutable), BitWidth(BW) {
13181318
}
13191319

13201320
public:
13211321
static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
13221322
IdentifierInfo *Id, QualType T,
1323-
DeclaratorInfo *DInfo, Expr *BW, bool Mutable);
1323+
TypeSourceInfo *TInfo, Expr *BW, bool Mutable);
13241324

13251325
/// isMutable - Determines whether this field is mutable (C++ only).
13261326
bool isMutable() const { return Mutable; }
@@ -1423,28 +1423,28 @@ class TypeDecl : public NamedDecl {
14231423

14241424
class TypedefDecl : public TypeDecl {
14251425
/// UnderlyingType - This is the type the typedef is set to.
1426-
DeclaratorInfo *DInfo;
1426+
TypeSourceInfo *TInfo;
14271427

14281428
TypedefDecl(DeclContext *DC, SourceLocation L,
1429-
IdentifierInfo *Id, DeclaratorInfo *DInfo)
1430-
: TypeDecl(Typedef, DC, L, Id), DInfo(DInfo) {}
1429+
IdentifierInfo *Id, TypeSourceInfo *TInfo)
1430+
: TypeDecl(Typedef, DC, L, Id), TInfo(TInfo) {}
14311431

14321432
virtual ~TypedefDecl() {}
14331433
public:
14341434

14351435
static TypedefDecl *Create(ASTContext &C, DeclContext *DC,
14361436
SourceLocation L, IdentifierInfo *Id,
1437-
DeclaratorInfo *DInfo);
1437+
TypeSourceInfo *TInfo);
14381438

1439-
DeclaratorInfo *getTypeDeclaratorInfo() const {
1440-
return DInfo;
1439+
TypeSourceInfo *getTypeSourceInfo() const {
1440+
return TInfo;
14411441
}
14421442

14431443
QualType getUnderlyingType() const {
1444-
return DInfo->getType();
1444+
return TInfo->getType();
14451445
}
1446-
void setTypeDeclaratorInfo(DeclaratorInfo *newType) {
1447-
DInfo = newType;
1446+
void setTypeSourceInfo(TypeSourceInfo *newType) {
1447+
TInfo = newType;
14481448
}
14491449

14501450
// Implement isa/cast/dyncast/etc.

clang/include/clang/AST/DeclCXX.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -804,15 +804,15 @@ class CXXRecordDecl : public RecordDecl {
804804
class CXXMethodDecl : public FunctionDecl {
805805
protected:
806806
CXXMethodDecl(Kind DK, CXXRecordDecl *RD, SourceLocation L,
807-
DeclarationName N, QualType T, DeclaratorInfo *DInfo,
807+
DeclarationName N, QualType T, TypeSourceInfo *TInfo,
808808
bool isStatic, bool isInline)
809-
: FunctionDecl(DK, RD, L, N, T, DInfo, (isStatic ? Static : None),
809+
: FunctionDecl(DK, RD, L, N, T, TInfo, (isStatic ? Static : None),
810810
isInline) {}
811811

812812
public:
813813
static CXXMethodDecl *Create(ASTContext &C, CXXRecordDecl *RD,
814814
SourceLocation L, DeclarationName N,
815-
QualType T, DeclaratorInfo *DInfo,
815+
QualType T, TypeSourceInfo *TInfo,
816816
bool isStatic = false,
817817
bool isInline = false);
818818

@@ -894,9 +894,9 @@ class CXXMethodDecl : public FunctionDecl {
894894
/// };
895895
/// @endcode
896896
class CXXBaseOrMemberInitializer {
897-
/// \brief Either the base class name (stored as a DeclaratorInfo*) or the
897+
/// \brief Either the base class name (stored as a TypeSourceInfo*) or the
898898
/// field being initialized.
899-
llvm::PointerUnion<DeclaratorInfo *, FieldDecl *> BaseOrMember;
899+
llvm::PointerUnion<TypeSourceInfo *, FieldDecl *> BaseOrMember;
900900

901901
/// \brief The source location for the field name.
902902
SourceLocation MemberLocation;
@@ -935,7 +935,7 @@ class CXXBaseOrMemberInitializer {
935935
/// CXXBaseOrMemberInitializer - Creates a new base-class initializer.
936936
explicit
937937
CXXBaseOrMemberInitializer(ASTContext &Context,
938-
DeclaratorInfo *DInfo, CXXConstructorDecl *C,
938+
TypeSourceInfo *TInfo, CXXConstructorDecl *C,
939939
SourceLocation L,
940940
Expr **Args, unsigned NumArgs,
941941
SourceLocation R);
@@ -961,7 +961,7 @@ class CXXBaseOrMemberInitializer {
961961

962962
/// isBaseInitializer - Returns true when this initializer is
963963
/// initializing a base class.
964-
bool isBaseInitializer() const { return BaseOrMember.is<DeclaratorInfo*>(); }
964+
bool isBaseInitializer() const { return BaseOrMember.is<TypeSourceInfo*>(); }
965965

966966
/// isMemberInitializer - Returns true when this initializer is
967967
/// initializing a non-static data member.
@@ -978,8 +978,8 @@ class CXXBaseOrMemberInitializer {
978978
Type *getBaseClass();
979979

980980
/// \brief Returns the declarator information for a base class initializer.
981-
DeclaratorInfo *getBaseClassInfo() const {
982-
return BaseOrMember.dyn_cast<DeclaratorInfo *>();
981+
TypeSourceInfo *getBaseClassInfo() const {
982+
return BaseOrMember.dyn_cast<TypeSourceInfo *>();
983983
}
984984

985985
/// getMember - If this is a member initializer, returns the
@@ -1064,9 +1064,9 @@ class CXXConstructorDecl : public CXXMethodDecl {
10641064
unsigned NumBaseOrMemberInitializers;
10651065

10661066
CXXConstructorDecl(CXXRecordDecl *RD, SourceLocation L,
1067-
DeclarationName N, QualType T, DeclaratorInfo *DInfo,
1067+
DeclarationName N, QualType T, TypeSourceInfo *TInfo,
10681068
bool isExplicit, bool isInline, bool isImplicitlyDeclared)
1069-
: CXXMethodDecl(CXXConstructor, RD, L, N, T, DInfo, false, isInline),
1069+
: CXXMethodDecl(CXXConstructor, RD, L, N, T, TInfo, false, isInline),
10701070
Explicit(isExplicit), ImplicitlyDefined(false),
10711071
BaseOrMemberInitializers(0), NumBaseOrMemberInitializers(0) {
10721072
setImplicit(isImplicitlyDeclared);
@@ -1076,7 +1076,7 @@ class CXXConstructorDecl : public CXXMethodDecl {
10761076
public:
10771077
static CXXConstructorDecl *Create(ASTContext &C, CXXRecordDecl *RD,
10781078
SourceLocation L, DeclarationName N,
1079-
QualType T, DeclaratorInfo *DInfo,
1079+
QualType T, TypeSourceInfo *TInfo,
10801080
bool isExplicit,
10811081
bool isInline, bool isImplicitlyDeclared);
10821082

@@ -1203,7 +1203,7 @@ class CXXDestructorDecl : public CXXMethodDecl {
12031203
CXXDestructorDecl(CXXRecordDecl *RD, SourceLocation L,
12041204
DeclarationName N, QualType T,
12051205
bool isInline, bool isImplicitlyDeclared)
1206-
: CXXMethodDecl(CXXDestructor, RD, L, N, T, /*DInfo=*/0, false, isInline),
1206+
: CXXMethodDecl(CXXDestructor, RD, L, N, T, /*TInfo=*/0, false, isInline),
12071207
ImplicitlyDefined(false), OperatorDelete(0) {
12081208
setImplicit(isImplicitlyDeclared);
12091209
}
@@ -1258,15 +1258,15 @@ class CXXConversionDecl : public CXXMethodDecl {
12581258
bool Explicit : 1;
12591259

12601260
CXXConversionDecl(CXXRecordDecl *RD, SourceLocation L,
1261-
DeclarationName N, QualType T, DeclaratorInfo *DInfo,
1261+
DeclarationName N, QualType T, TypeSourceInfo *TInfo,
12621262
bool isInline, bool isExplicit)
1263-
: CXXMethodDecl(CXXConversion, RD, L, N, T, DInfo, false, isInline),
1263+
: CXXMethodDecl(CXXConversion, RD, L, N, T, TInfo, false, isInline),
12641264
Explicit(isExplicit) { }
12651265

12661266
public:
12671267
static CXXConversionDecl *Create(ASTContext &C, CXXRecordDecl *RD,
12681268
SourceLocation L, DeclarationName N,
1269-
QualType T, DeclaratorInfo *DInfo,
1269+
QualType T, TypeSourceInfo *TInfo,
12701270
bool isInline, bool isExplicit);
12711271

12721272
/// isExplicit - Whether this is an explicit conversion operator

clang/include/clang/AST/DeclObjC.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,14 @@ class ObjCIvarDecl : public FieldDecl {
578578

579579
private:
580580
ObjCIvarDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
581-
QualType T, DeclaratorInfo *DInfo, AccessControl ac, Expr *BW)
582-
: FieldDecl(ObjCIvar, DC, L, Id, T, DInfo, BW, /*Mutable=*/false),
581+
QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW)
582+
: FieldDecl(ObjCIvar, DC, L, Id, T, TInfo, BW, /*Mutable=*/false),
583583
DeclAccess(ac) {}
584584

585585
public:
586586
static ObjCIvarDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
587587
IdentifierInfo *Id, QualType T,
588-
DeclaratorInfo *DInfo,
588+
TypeSourceInfo *TInfo,
589589
AccessControl ac, Expr *BW = NULL);
590590

591591
void setAccessControl(AccessControl ac) { DeclAccess = ac; }
@@ -612,7 +612,7 @@ class ObjCAtDefsFieldDecl : public FieldDecl {
612612
ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
613613
QualType T, Expr *BW)
614614
: FieldDecl(ObjCAtDefsField, DC, L, Id, T,
615-
/*DInfo=*/0, // FIXME: Do ObjCAtDefs have declarators ?
615+
/*TInfo=*/0, // FIXME: Do ObjCAtDefs have declarators ?
616616
BW, /*Mutable=*/false) {}
617617

618618
public:

clang/include/clang/AST/DeclTemplate.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ class TemplateTypeParmDecl : public TypeDecl {
573573
bool ParameterPack : 1;
574574

575575
/// \brief The default template argument, if any.
576-
DeclaratorInfo *DefaultArgument;
576+
TypeSourceInfo *DefaultArgument;
577577

578578
TemplateTypeParmDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
579579
bool Typename, QualType Type, bool ParameterPack)
@@ -601,7 +601,7 @@ class TemplateTypeParmDecl : public TypeDecl {
601601
QualType getDefaultArgument() const { return DefaultArgument->getType(); }
602602

603603
/// \brief Retrieves the default argument's source information, if any.
604-
DeclaratorInfo *getDefaultArgumentInfo() const { return DefaultArgument; }
604+
TypeSourceInfo *getDefaultArgumentInfo() const { return DefaultArgument; }
605605

606606
/// \brief Retrieves the location of the default argument declaration.
607607
SourceLocation getDefaultArgumentLoc() const;
@@ -613,7 +613,7 @@ class TemplateTypeParmDecl : public TypeDecl {
613613
/// \brief Set the default argument for this template parameter, and
614614
/// whether that default argument was inherited from another
615615
/// declaration.
616-
void setDefaultArgument(DeclaratorInfo *DefArg, bool Inherited) {
616+
void setDefaultArgument(TypeSourceInfo *DefArg, bool Inherited) {
617617
DefaultArgument = DefArg;
618618
InheritedDefault = Inherited;
619619
}
@@ -652,15 +652,15 @@ class NonTypeTemplateParmDecl
652652

653653
NonTypeTemplateParmDecl(DeclContext *DC, SourceLocation L, unsigned D,
654654
unsigned P, IdentifierInfo *Id, QualType T,
655-
DeclaratorInfo *DInfo)
656-
: VarDecl(NonTypeTemplateParm, DC, L, Id, T, DInfo, VarDecl::None),
655+
TypeSourceInfo *TInfo)
656+
: VarDecl(NonTypeTemplateParm, DC, L, Id, T, TInfo, VarDecl::None),
657657
TemplateParmPosition(D, P), DefaultArgument(0)
658658
{ }
659659

660660
public:
661661
static NonTypeTemplateParmDecl *
662662
Create(ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D,
663-
unsigned P, IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo);
663+
unsigned P, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo);
664664

665665
using TemplateParmPosition::getDepth;
666666
using TemplateParmPosition::getPosition;

0 commit comments

Comments
 (0)