aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/ASTContext.cpp34
-rw-r--r--lib/AST/Decl.cpp22
-rw-r--r--lib/AST/DeclCXX.cpp22
-rw-r--r--lib/AST/DeclObjC.cpp4
-rw-r--r--lib/AST/DeclTemplate.cpp4
-rw-r--r--lib/AST/TemplateBase.cpp2
-rw-r--r--lib/Frontend/PCHReader.cpp10
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp8
-rw-r--r--lib/Frontend/PCHReaderStmt.cpp2
-rw-r--r--lib/Frontend/PCHWriter.cpp10
-rw-r--r--lib/Frontend/PCHWriterDecl.cpp6
-rw-r--r--lib/Frontend/PCHWriterStmt.cpp2
-rw-r--r--lib/Frontend/RewriteObjC.cpp8
-rw-r--r--lib/Index/ASTVisitor.h4
-rw-r--r--lib/Index/ResolveLocation.cpp42
-rw-r--r--lib/Sema/Sema.cpp16
-rw-r--r--lib/Sema/Sema.h40
-rw-r--r--lib/Sema/SemaDecl.cpp80
-rw-r--r--lib/Sema/SemaDeclAttr.cpp8
-rw-r--r--lib/Sema/SemaDeclCXX.cpp56
-rw-r--r--lib/Sema/SemaDeclObjC.cpp4
-rw-r--r--lib/Sema/SemaExpr.cpp14
-rw-r--r--lib/Sema/SemaExprCXX.cpp10
-rw-r--r--lib/Sema/SemaTemplate.cpp38
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp6
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp28
-rw-r--r--lib/Sema/SemaType.cpp52
-rw-r--r--lib/Sema/TreeTransform.h44
28 files changed, 288 insertions, 288 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index bce7d67edf..cc96a5dc0e 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1009,31 +1009,31 @@ void ASTContext::setObjCImplementation(ObjCCategoryDecl *CatD,
ObjCImpls[CatD] = ImplD;
}
-/// \brief Allocate an uninitialized DeclaratorInfo.
+/// \brief Allocate an uninitialized TypeSourceInfo.
///
-/// The caller should initialize the memory held by DeclaratorInfo using
+/// The caller should initialize the memory held by TypeSourceInfo using
/// the TypeLoc wrappers.
///
/// \param T the type that will be the basis for type source info. This type
/// should refer to how the declarator was written in source code, not to
/// what type semantic analysis resolved the declarator to.
-DeclaratorInfo *ASTContext::CreateDeclaratorInfo(QualType T,
+TypeSourceInfo *ASTContext::CreateTypeSourceInfo(QualType T,
unsigned DataSize) {
if (!DataSize)
DataSize = TypeLoc::getFullDataSizeForType(T);
else
assert(DataSize == TypeLoc::getFullDataSizeForType(T) &&
- "incorrect data size provided to CreateDeclaratorInfo!");
+ "incorrect data size provided to CreateTypeSourceInfo!");
- DeclaratorInfo *DInfo =
- (DeclaratorInfo*)BumpAlloc.Allocate(sizeof(DeclaratorInfo) + DataSize, 8);
- new (DInfo) DeclaratorInfo(T);
- return DInfo;
+ TypeSourceInfo *TInfo =
+ (TypeSourceInfo*)BumpAlloc.Allocate(sizeof(TypeSourceInfo) + DataSize, 8);
+ new (TInfo) TypeSourceInfo(T);
+ return TInfo;
}
-DeclaratorInfo *ASTContext::getTrivialDeclaratorInfo(QualType T,
+TypeSourceInfo *ASTContext::getTrivialTypeSourceInfo(QualType T,
SourceLocation L) {
- DeclaratorInfo *DI = CreateDeclaratorInfo(T);
+ TypeSourceInfo *DI = CreateTypeSourceInfo(T);
DI->getTypeLoc().initialize(L);
return DI;
}
@@ -2808,7 +2808,7 @@ QualType ASTContext::getCFConstantStringType() {
for (unsigned i = 0; i < 4; ++i) {
FieldDecl *Field = FieldDecl::Create(*this, CFConstantStringTypeDecl,
SourceLocation(), 0,
- FieldTypes[i], /*DInfo=*/0,
+ FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
/*Mutable=*/false);
CFConstantStringTypeDecl->addDecl(Field);
@@ -2844,7 +2844,7 @@ QualType ASTContext::getObjCFastEnumerationStateType() {
FieldDecl *Field = FieldDecl::Create(*this,
ObjCFastEnumerationStateTypeDecl,
SourceLocation(), 0,
- FieldTypes[i], /*DInfo=*/0,
+ FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
/*Mutable=*/false);
ObjCFastEnumerationStateTypeDecl->addDecl(Field);
@@ -2880,7 +2880,7 @@ QualType ASTContext::getBlockDescriptorType() {
T,
SourceLocation(),
&Idents.get(FieldNames[i]),
- FieldTypes[i], /*DInfo=*/0,
+ FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
/*Mutable=*/false);
T->addDecl(Field);
@@ -2927,7 +2927,7 @@ QualType ASTContext::getBlockDescriptorExtendedType() {
T,
SourceLocation(),
&Idents.get(FieldNames[i]),
- FieldTypes[i], /*DInfo=*/0,
+ FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
/*Mutable=*/false);
T->addDecl(Field);
@@ -3005,7 +3005,7 @@ QualType ASTContext::BuildByRefType(const char *DeclName, QualType Ty) {
continue;
FieldDecl *Field = FieldDecl::Create(*this, T, SourceLocation(),
&Idents.get(FieldNames[i]),
- FieldTypes[i], /*DInfo=*/0,
+ FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0, /*Mutable=*/false);
T->addDecl(Field);
}
@@ -3048,7 +3048,7 @@ QualType ASTContext::getBlockParmType(
for (size_t i = 0; i < 5; ++i) {
FieldDecl *Field = FieldDecl::Create(*this, T, SourceLocation(),
&Idents.get(FieldNames[i]),
- FieldTypes[i], /*DInfo=*/0,
+ FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0, /*Mutable=*/false);
T->addDecl(Field);
}
@@ -3068,7 +3068,7 @@ QualType ASTContext::getBlockParmType(
FieldType);
FieldDecl *Field = FieldDecl::Create(*this, T, SourceLocation(),
- Name, FieldType, /*DInfo=*/0,
+ Name, FieldType, /*TInfo=*/0,
/*BitWidth=*/0, /*Mutable=*/false);
T->addDecl(Field);
}
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 51a4731bfc..42c9ef948c 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -38,7 +38,7 @@ void Attr::Destroy(ASTContext &C) {
}
/// \brief Return the TypeLoc wrapper for the type source info.
-TypeLoc DeclaratorInfo::getTypeLoc() const {
+TypeLoc TypeSourceInfo::getTypeLoc() const {
return TypeLoc(Ty, (void*)(this + 1));
}
@@ -86,9 +86,9 @@ const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) {
ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
- QualType T, DeclaratorInfo *DInfo,
+ QualType T, TypeSourceInfo *TInfo,
StorageClass S, Expr *DefArg) {
- return new (C) ParmVarDecl(ParmVar, DC, L, Id, T, DInfo, S, DefArg);
+ return new (C) ParmVarDecl(ParmVar, DC, L, Id, T, TInfo, S, DefArg);
}
SourceRange ParmVarDecl::getDefaultArgRange() const {
@@ -136,11 +136,11 @@ bool VarDecl::isExternC() const {
FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L,
DeclarationName N, QualType T,
- DeclaratorInfo *DInfo,
+ TypeSourceInfo *TInfo,
StorageClass S, bool isInline,
bool hasWrittenPrototype) {
FunctionDecl *New
- = new (C) FunctionDecl(Function, DC, L, N, T, DInfo, S, isInline);
+ = new (C) FunctionDecl(Function, DC, L, N, T, TInfo, S, isInline);
New->HasWrittenPrototype = hasWrittenPrototype;
return New;
}
@@ -151,8 +151,8 @@ BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {
FieldDecl *FieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id, QualType T,
- DeclaratorInfo *DInfo, Expr *BW, bool Mutable) {
- return new (C) FieldDecl(Decl::Field, DC, L, Id, T, DInfo, BW, Mutable);
+ TypeSourceInfo *TInfo, Expr *BW, bool Mutable) {
+ return new (C) FieldDecl(Decl::Field, DC, L, Id, T, TInfo, BW, Mutable);
}
bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -179,8 +179,8 @@ void EnumConstantDecl::Destroy(ASTContext& C) {
TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
- DeclaratorInfo *DInfo) {
- return new (C) TypedefDecl(DC, L, Id, DInfo);
+ TypeSourceInfo *TInfo) {
+ return new (C) TypedefDecl(DC, L, Id, TInfo);
}
EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
@@ -535,9 +535,9 @@ SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {
//===----------------------------------------------------------------------===//
VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
+ IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo,
StorageClass S) {
- return new (C) VarDecl(Var, DC, L, Id, T, DInfo, S);
+ return new (C) VarDecl(Var, DC, L, Id, T, TInfo, S);
}
void VarDecl::Destroy(ASTContext& C) {
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 766cb01814..4680b87cb2 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -540,9 +540,9 @@ CXXDestructorDecl *CXXRecordDecl::getDestructor(ASTContext &Context) {
CXXMethodDecl *
CXXMethodDecl::Create(ASTContext &C, CXXRecordDecl *RD,
SourceLocation L, DeclarationName N,
- QualType T, DeclaratorInfo *DInfo,
+ QualType T, TypeSourceInfo *TInfo,
bool isStatic, bool isInline) {
- return new (C) CXXMethodDecl(CXXMethod, RD, L, N, T, DInfo,
+ return new (C) CXXMethodDecl(CXXMethod, RD, L, N, T, TInfo,
isStatic, isInline);
}
@@ -665,11 +665,11 @@ bool CXXMethodDecl::hasInlineBody() const {
CXXBaseOrMemberInitializer::
CXXBaseOrMemberInitializer(ASTContext &Context,
- DeclaratorInfo *DInfo, CXXConstructorDecl *C,
+ TypeSourceInfo *TInfo, CXXConstructorDecl *C,
SourceLocation L,
Expr **Args, unsigned NumArgs,
SourceLocation R)
- : BaseOrMember(DInfo), Args(0), NumArgs(0), CtorOrAnonUnion(C),
+ : BaseOrMember(TInfo), Args(0), NumArgs(0), CtorOrAnonUnion(C),
LParenLoc(L), RParenLoc(R)
{
if (NumArgs > 0) {
@@ -706,21 +706,21 @@ void CXXBaseOrMemberInitializer::Destroy(ASTContext &Context) {
TypeLoc CXXBaseOrMemberInitializer::getBaseClassLoc() const {
if (isBaseInitializer())
- return BaseOrMember.get<DeclaratorInfo*>()->getTypeLoc();
+ return BaseOrMember.get<TypeSourceInfo*>()->getTypeLoc();
else
return TypeLoc();
}
Type *CXXBaseOrMemberInitializer::getBaseClass() {
if (isBaseInitializer())
- return BaseOrMember.get<DeclaratorInfo*>()->getType().getTypePtr();
+ return BaseOrMember.get<TypeSourceInfo*>()->getType().getTypePtr();
else
return 0;
}
const Type *CXXBaseOrMemberInitializer::getBaseClass() const {
if (isBaseInitializer())
- return BaseOrMember.get<DeclaratorInfo*>()->getType().getTypePtr();
+ return BaseOrMember.get<TypeSourceInfo*>()->getType().getTypePtr();
else
return 0;
}
@@ -739,12 +739,12 @@ SourceRange CXXBaseOrMemberInitializer::getSourceRange() const {
CXXConstructorDecl *
CXXConstructorDecl::Create(ASTContext &C, CXXRecordDecl *RD,
SourceLocation L, DeclarationName N,
- QualType T, DeclaratorInfo *DInfo,
+ QualType T, TypeSourceInfo *TInfo,
bool isExplicit,
bool isInline, bool isImplicitlyDeclared) {
assert(N.getNameKind() == DeclarationName::CXXConstructorName &&
"Name must refer to a constructor");
- return new (C) CXXConstructorDecl(RD, L, N, T, DInfo, isExplicit, isInline,
+ return new (C) CXXConstructorDecl(RD, L, N, T, TInfo, isExplicit, isInline,
isImplicitlyDeclared);
}
@@ -856,11 +856,11 @@ CXXConstructorDecl::Destroy(ASTContext& C) {
CXXConversionDecl *
CXXConversionDecl::Create(ASTContext &C, CXXRecordDecl *RD,
SourceLocation L, DeclarationName N,
- QualType T, DeclaratorInfo *DInfo,
+ QualType T, TypeSourceInfo *TInfo,
bool isInline, bool isExplicit) {
assert(N.getNameKind() == DeclarationName::CXXConversionFunctionName &&
"Name must refer to a conversion function");
- return new (C) CXXConversionDecl(RD, L, N, T, DInfo, isInline, isExplicit);
+ return new (C) CXXConversionDecl(RD, L, N, T, TInfo, isInline, isExplicit);
}
FriendDecl *FriendDecl::Create(ASTContext &C, DeclContext *DC,
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index c33720f563..2506f27e6f 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -501,9 +501,9 @@ bool ObjCInterfaceDecl::ClassImplementsProtocol(ObjCProtocolDecl *lProto,
ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
- QualType T, DeclaratorInfo *DInfo,
+ QualType T, TypeSourceInfo *TInfo,
AccessControl ac, Expr *BW) {
- return new (C) ObjCIvarDecl(DC, L, Id, T, DInfo, ac, BW);
+ return new (C) ObjCIvarDecl(DC, L, Id, T, TInfo, ac, BW);
}
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index 902339e1ef..75b3975322 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -262,8 +262,8 @@ NonTypeTemplateParmDecl *
NonTypeTemplateParmDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L, unsigned D, unsigned P,
IdentifierInfo *Id, QualType T,
- DeclaratorInfo *DInfo) {
- return new (C) NonTypeTemplateParmDecl(DC, L, D, P, Id, T, DInfo);
+ TypeSourceInfo *TInfo) {
+ return new (C) NonTypeTemplateParmDecl(DC, L, D, P, Id, T, TInfo);
}
SourceLocation NonTypeTemplateParmDecl::getDefaultArgumentLoc() const {
diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp
index f341b45fb9..e9b1725641 100644
--- a/lib/AST/TemplateBase.cpp
+++ b/lib/AST/TemplateBase.cpp
@@ -102,7 +102,7 @@ SourceRange TemplateArgumentLoc::getSourceRange() const {
return getSourceDeclExpression()->getSourceRange();
case TemplateArgument::Type:
- return getSourceDeclaratorInfo()->getTypeLoc().getFullSourceRange();
+ return getTypeSourceInfo()->getTypeLoc().getFullSourceRange();
case TemplateArgument::Template:
if (getTemplateQualifierRange().isValid())
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index 811f9ed4af..aae201400d 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -2113,17 +2113,17 @@ void TypeLocReader::VisitObjCObjectPointerTypeLoc(ObjCObjectPointerTypeLoc TL) {
TL.setProtocolLoc(i, SourceLocation::getFromRawEncoding(Record[Idx++]));
}
-DeclaratorInfo *PCHReader::GetDeclaratorInfo(const RecordData &Record,
+TypeSourceInfo *PCHReader::GetTypeSourceInfo(const RecordData &Record,
unsigned &Idx) {
QualType InfoTy = GetType(Record[Idx++]);
if (InfoTy.isNull())
return 0;
- DeclaratorInfo *DInfo = getContext()->CreateDeclaratorInfo(InfoTy);
+ TypeSourceInfo *TInfo = getContext()->CreateTypeSourceInfo(InfoTy);
TypeLocReader TLR(*this, Record, Idx);
- for (TypeLoc TL = DInfo->getTypeLoc(); !TL.isNull(); TL = TL.getNextTypeLoc())
+ for (TypeLoc TL = TInfo->getTypeLoc(); !TL.isNull(); TL = TL.getNextTypeLoc())
TLR.Visit(TL);
- return DInfo;
+ return TInfo;
}
QualType PCHReader::GetType(pch::TypeID ID) {
@@ -2189,7 +2189,7 @@ PCHReader::GetTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind,
case TemplateArgument::Expression:
return ReadDeclExpr();
case TemplateArgument::Type:
- return GetDeclaratorInfo(Record, Index);
+ return GetTypeSourceInfo(Record, Index);
case TemplateArgument::Template: {
SourceLocation
QualStart = SourceLocation::getFromRawEncoding(Record[Index++]),
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 03f3b47679..40d48c53af 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -107,7 +107,7 @@ void PCHDeclReader::VisitTypedefDecl(TypedefDecl *TD) {
// the type associated with the TypedefDecl.
VisitNamedDecl(TD);
uint64_t TypeData = Record[Idx++];
- TD->setTypeDeclaratorInfo(Reader.GetDeclaratorInfo(Record, Idx));
+ TD->setTypeSourceInfo(Reader.GetTypeSourceInfo(Record, Idx));
TD->setTypeForDecl(Reader.GetType(TypeData).getTypePtr());
}
@@ -150,9 +150,9 @@ void PCHDeclReader::VisitEnumConstantDecl(EnumConstantDecl *ECD) {
void PCHDeclReader::VisitDeclaratorDecl(DeclaratorDecl *DD) {
VisitValueDecl(DD);
- DeclaratorInfo *DInfo = Reader.GetDeclaratorInfo(Record, Idx);
- if (DInfo)
- DD->setDeclaratorInfo(DInfo);
+ TypeSourceInfo *TInfo = Reader.GetTypeSourceInfo(Record, Idx);
+ if (TInfo)
+ DD->setTypeSourceInfo(TInfo);
}
void PCHDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index 4a3510cb1c..b2fc644c6d 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -428,7 +428,7 @@ unsigned PCHStmtReader::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
E->setArgument(cast<Expr>(StmtStack.back()));
++Idx;
} else {
- E->setArgument(Reader.GetDeclaratorInfo(Record, Idx));
+ E->setArgument(Reader.GetTypeSourceInfo(Record, Idx));
}
E->setOperatorLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 0e6d1d2f66..a190013177 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -2140,7 +2140,7 @@ void PCHWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
AddStmt(Arg.getLocInfo().getAsExpr());
break;
case TemplateArgument::Type:
- AddDeclaratorInfo(Arg.getLocInfo().getAsDeclaratorInfo(), Record);
+ AddTypeSourceInfo(Arg.getLocInfo().getAsTypeSourceInfo(), Record);
break;
case TemplateArgument::Template:
Record.push_back(
@@ -2156,15 +2156,15 @@ void PCHWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
}
}
-void PCHWriter::AddDeclaratorInfo(DeclaratorInfo *DInfo, RecordData &Record) {
- if (DInfo == 0) {
+void PCHWriter::AddTypeSourceInfo(TypeSourceInfo *TInfo, RecordData &Record) {
+ if (TInfo == 0) {
AddTypeRef(QualType(), Record);
return;
}
- AddTypeRef(DInfo->getType(), Record);
+ AddTypeRef(TInfo->getType(), Record);
TypeLocWriter TLW(*this, Record);
- for (TypeLoc TL = DInfo->getTypeLoc(); !TL.isNull(); TL = TL.getNextTypeLoc())
+ for (TypeLoc TL = TInfo->getTypeLoc(); !TL.isNull(); TL = TL.getNextTypeLoc())
TLW.Visit(TL);
}
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp
index 64b1aaf478..1ba113e14e 100644
--- a/lib/Frontend/PCHWriterDecl.cpp
+++ b/lib/Frontend/PCHWriterDecl.cpp
@@ -106,7 +106,7 @@ void PCHDeclWriter::VisitTypeDecl(TypeDecl *D) {
void PCHDeclWriter::VisitTypedefDecl(TypedefDecl *D) {
VisitTypeDecl(D);
- Writer.AddDeclaratorInfo(D->getTypeDeclaratorInfo(), Record);
+ Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record);
Code = pch::DECL_TYPEDEF;
}
@@ -151,7 +151,7 @@ void PCHDeclWriter::VisitEnumConstantDecl(EnumConstantDecl *D) {
void PCHDeclWriter::VisitDeclaratorDecl(DeclaratorDecl *D) {
VisitValueDecl(D);
- Writer.AddDeclaratorInfo(D->getDeclaratorInfo(), Record);
+ Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record);
}
void PCHDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
@@ -370,7 +370,7 @@ void PCHDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
// If the assumptions about the DECL_PARM_VAR abbrev are true, use it. Here
// we dynamically check for the properties that we optimize for, but don't
// know are true of all PARM_VAR_DECLs.
- if (!D->getDeclaratorInfo() &&
+ if (!D->getTypeSourceInfo() &&
!D->hasAttrs() &&
!D->isImplicit() &&
!D->isUsed() &&
diff --git a/lib/Frontend/PCHWriterStmt.cpp b/lib/Frontend/PCHWriterStmt.cpp
index 27b83ed6cb..22f7ad66d9 100644
--- a/lib/Frontend/PCHWriterStmt.cpp
+++ b/lib/Frontend/PCHWriterStmt.cpp
@@ -388,7 +388,7 @@ void PCHStmtWriter::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
VisitExpr(E);
Record.push_back(E->isSizeOf());
if (E->isArgumentType())
- Writer.AddDeclaratorInfo(E->getArgumentTypeInfo(), Record);
+ Writer.AddTypeSourceInfo(E->getArgumentTypeInfo(), Record);
else {
Record.push_back(0);
Writer.WriteSubStmt(E->getArgumentExpr());
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index cd497a7838..df85c13cea 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -2678,7 +2678,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp) {
// Build sizeof(returnType)
SizeOfAlignOfExpr *sizeofExpr = new (Context) SizeOfAlignOfExpr(true,
- Context->getTrivialDeclaratorInfo(returnType),
+ Context->getTrivialTypeSourceInfo(returnType),
Context->getSizeType(),
SourceLocation(), SourceLocation());
// (sizeof(returnType) <= 8 ? objc_msgSend(...) : objc_msgSend_stret(...))
@@ -2718,12 +2718,12 @@ Stmt *RewriteObjC::RewriteMessageExpr(ObjCMessageExpr *Exp) {
// typedef struct objc_object Protocol;
QualType RewriteObjC::getProtocolType() {
if (!ProtocolTypeDecl) {
- DeclaratorInfo *DInfo
- = Context->getTrivialDeclaratorInfo(Context->getObjCIdType());
+ TypeSourceInfo *TInfo
+ = Context->getTrivialTypeSourceInfo(Context->getObjCIdType());
ProtocolTypeDecl = TypedefDecl::Create(*Context, TUDecl,
SourceLocation(),
&Context->Idents.get("Protocol"),
- DInfo);
+ TInfo);
}
return Context->getTypeDeclType(ProtocolTypeDecl);
}
diff --git a/lib/Index/ASTVisitor.h b/lib/Index/ASTVisitor.h
index 0ae78fb74f..6cfa381608 100644
--- a/lib/Index/ASTVisitor.h
+++ b/lib/Index/ASTVisitor.h
@@ -52,8 +52,8 @@ public:
void VisitDeclaratorDecl(DeclaratorDecl *D) {
BaseDeclVisitor::VisitDeclaratorDecl(D);
- if (DeclaratorInfo *DInfo = D->getDeclaratorInfo())
- Visit(DInfo->getTypeLoc());
+ if (TypeSourceInfo *TInfo = D->getTypeSourceInfo())
+ Visit(TInfo->getTypeLoc());
}
void VisitFunctionDecl(FunctionDecl *D) {
diff --git a/lib/Index/ResolveLocation.cpp b/lib/Index/ResolveLocation.cpp
index c7379f7a83..81a5de44bf 100644
--- a/lib/Index/ResolveLocation.cpp
+++ b/lib/Index/ResolveLocation.cpp
@@ -30,7 +30,7 @@ protected:
ASTContext &Ctx;
SourceLocation Loc;
- ASTLocation ResolveInDeclarator(Decl *D, Stmt *Stm, DeclaratorInfo *DInfo);
+ ASTLocation ResolveInDeclarator(Decl *D, Stmt *Stm, TypeSourceInfo *TInfo);
enum RangePos {
BeforeLoc,
@@ -39,13 +39,13 @@ protected:
};
RangePos CheckRange(SourceRange Range);
- RangePos CheckRange(DeclaratorInfo *DInfo);
+ RangePos CheckRange(TypeSourceInfo *TInfo);
RangePos CheckRange(Decl *D) {
if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D))
- if (ContainsLocation(DD->getDeclaratorInfo()))
+ if (ContainsLocation(DD->getTypeSourceInfo()))
return ContainsLoc;
if (TypedefDecl *TD = dyn_cast<TypedefDecl>(D))
- if (ContainsLocation(TD->getTypeDeclaratorInfo()))
+ if (ContainsLocation(TD->getTypeSourceInfo()))
return ContainsLoc;
return CheckRange(D->getSourceRange());
@@ -142,9 +142,9 @@ StmtLocResolver::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *Node) {
"Should visit only after verifying that loc is in range");
if (Node->isArgumentType()) {
- DeclaratorInfo *DInfo = Node->getArgumentTypeInfo();
- if (ContainsLocation(DInfo))
- return ResolveInDeclarator(Parent, Node, DInfo);
+ TypeSourceInfo *TInfo = Node->getArgumentTypeInfo();
+ if (ContainsLocation(TInfo))
+ return ResolveInDeclarator(Parent, Node, TInfo);
} else {
Expr *SubNode = Node->getArgumentExpr();
if (ContainsLocation(SubNode))
@@ -245,8 +245,8 @@ ASTLocation DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
- if (ContainsLocation(D->getDeclaratorInfo()))
- return ResolveInDeclarator(D, 0, D->getDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, 0, D->getTypeSourceInfo());
// First, search through the parameters of the function.
for (FunctionDecl::param_iterator
@@ -296,8 +296,8 @@ ASTLocation DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) {
ASTLocation DeclLocResolver::VisitDeclaratorDecl(DeclaratorDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
- if (ContainsLocation(D->getDeclaratorInfo()))
- return ResolveInDeclarator(D, /*Stmt=*/0, D->getDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, /*Stmt=*/0, D->getTypeSourceInfo());
return ASTLocation(D);
}
@@ -306,8 +306,8 @@ ASTLocation DeclLocResolver::VisitTypedefDecl(TypedefDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
- if (ContainsLocation(D->getTypeDeclaratorInfo()))
- return ResolveInDeclarator(D, /*Stmt=*/0, D->getTypeDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, /*Stmt=*/0, D->getTypeSourceInfo());
return ASTLocation(D);
}
@@ -321,8 +321,8 @@ ASTLocation DeclLocResolver::VisitVarDecl(VarDecl *D) {
if (Init && ContainsLocation(Init))
return StmtLocResolver(Ctx, Loc, D).Visit(Init);
- if (ContainsLocation(D->getDeclaratorInfo()))
- return ResolveInDeclarator(D, 0, D->getDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, 0, D->getTypeSourceInfo());
return ASTLocation(D);
}
@@ -491,12 +491,12 @@ ASTLocation TypeLocResolver::VisitTypeLoc(TypeLoc TL) {
}
ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,
- DeclaratorInfo *DInfo) {
- assert(ContainsLocation(DInfo) &&
+ TypeSourceInfo *TInfo) {
+ assert(ContainsLocation(TInfo) &&
"Should visit only after verifying that loc is in range");
(void)TypeLocResolver(Ctx, Loc, D);
- for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
+ for (TypeLoc TL = TInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
if (ContainsLocation(TL))
return TypeLocResolver(Ctx, Loc, D).Visit(TL);
@@ -504,11 +504,11 @@ ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,
return ASTLocation(D, Stm);
}
-LocResolverBase::RangePos LocResolverBase::CheckRange(DeclaratorInfo *DInfo) {
- if (!DInfo)
+LocResolverBase::RangePos LocResolverBase::CheckRange(TypeSourceInfo *TInfo) {
+ if (!TInfo)
return BeforeLoc; // Keep looking.
- for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
+ for (TypeLoc TL = TInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
if (ContainsLocation(TL))
return ContainsLoc;
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index f0812bfe7f..29efbd7bec 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -278,20 +278,20 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
PushDeclContext(S, Context.getTranslationUnitDecl());
if (PP.getTargetInfo().getPointerWidth(0) >= 64) {
- DeclaratorInfo *DInfo;
+ TypeSourceInfo *TInfo;
// Install [u]int128_t for 64-bit targets.
- DInfo = Context.getTrivialDeclaratorInfo(Context.Int128Ty);
+ TInfo = Context.getTrivialTypeSourceInfo(Context.Int128Ty);
PushOnScopeChains(TypedefDecl::Create(Context, CurContext,
SourceLocation(),
&Context.Idents.get("__int128_t"),
- DInfo), TUScope);
+ TInfo), TUScope);
- DInfo = Context.getTrivialDeclaratorInfo(Context.UnsignedInt128Ty);
+ TInfo = Context.getTrivialTypeSourceInfo(Context.UnsignedInt128Ty);
PushOnScopeChains(TypedefDecl::Create(Context, CurContext,
SourceLocation(),
&Context.Idents.get("__uint128_t"),
- DInfo), TUScope);
+ TInfo), TUScope);
}
<