aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema')
-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
13 files changed, 198 insertions, 198 deletions
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);
}
@@ -301,7 +301,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
if (Context.getObjCSelType().isNull()) {
// Create the built-in typedef for 'SEL'.
QualType SelT = Context.getPointerType(Context.ObjCBuiltinSelTy);
- DeclaratorInfo *SelInfo = Context.getTrivialDeclaratorInfo(SelT);
+ TypeSourceInfo *SelInfo = Context.getTrivialTypeSourceInfo(SelT);
TypedefDecl *SelTypedef
= TypedefDecl::Create(Context, CurContext, SourceLocation(),
&Context.Idents.get("SEL"), SelInfo);
@@ -322,7 +322,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
// Create the built-in typedef for 'id'.
if (Context.getObjCIdType().isNull()) {
QualType IdT = Context.getObjCObjectPointerType(Context.ObjCBuiltinIdTy);
- DeclaratorInfo *IdInfo = Context.getTrivialDeclaratorInfo(IdT);
+ TypeSourceInfo *IdInfo = Context.getTrivialTypeSourceInfo(IdT);
TypedefDecl *IdTypedef
= TypedefDecl::Create(Context, CurContext, SourceLocation(),
&Context.Idents.get("id"), IdInfo);
@@ -334,7 +334,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
if (Context.getObjCClassType().isNull()) {
QualType ClassType
= Context.getObjCObjectPointerType(Context.ObjCBuiltinClassTy);
- DeclaratorInfo *ClassInfo = Context.getTrivialDeclaratorInfo(ClassType);
+ TypeSourceInfo *ClassInfo = Context.getTrivialTypeSourceInfo(ClassType);
TypedefDecl *ClassTypedef
= TypedefDecl::Create(Context, CurContext, SourceLocation(),
&Context.Idents.get("Class"), ClassInfo);
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 2fb317635f..e4ee8ce73c 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -131,7 +131,7 @@ struct BlockSemaInfo {
BlockSemaInfo *PrevBlockInfo;
};
-/// \brief Holds a QualType and a DeclaratorInfo* that came out of a declarator
+/// \brief Holds a QualType and a TypeSourceInfo* that came out of a declarator
/// parsing.
///
/// LocInfoType is a "transient" type, only needed for passing to/from Parser
@@ -144,17 +144,17 @@ class LocInfoType : public Type {
LocInfo = (1 << TypeClassBitSize) - 1
};
- DeclaratorInfo *DeclInfo;
+ TypeSourceInfo *DeclInfo;
- LocInfoType(QualType ty, DeclaratorInfo *DInfo)
- : Type((TypeClass)LocInfo, ty, ty->isDependentType()), DeclInfo(DInfo) {
+ LocInfoType(QualType ty, TypeSourceInfo *TInfo)
+ : Type((TypeClass)LocInfo, ty, ty->isDependentType()), DeclInfo(TInfo) {
assert(getTypeClass() == (TypeClass)LocInfo && "LocInfo didn't fit in TC?");
}
friend class Sema;
public:
QualType getType() const { return getCanonicalTypeInternal(); }
- DeclaratorInfo *getDeclaratorInfo() const { return DeclInfo; }
+ TypeSourceInfo *getTypeSourceInfo() const { return DeclInfo; }
virtual void getAsStringInternal(std::string &Str,
const PrintingPolicy &Policy) const;
@@ -517,14 +517,14 @@ public:
QualType BuildBlockPointerType(QualType T, unsigned Quals,
SourceLocation Loc, DeclarationName Entity);
QualType GetTypeForDeclarator(Declarator &D, Scope *S,
- DeclaratorInfo **DInfo = 0,
+ TypeSourceInfo **TInfo = 0,
TagDecl **OwnedDecl = 0);
- DeclaratorInfo *GetDeclaratorInfoForDeclarator(Declarator &D, QualType T);
- /// \brief Create a LocInfoType to hold the given QualType and DeclaratorInfo.
- QualType CreateLocInfoType(QualType T, DeclaratorInfo *DInfo);
+ TypeSourceInfo *GetTypeSourceInfoForDeclarator(Declarator &D, QualType T);
+ /// \brief Create a LocInfoType to hold the given QualType and TypeSourceInfo.
+ QualType CreateLocInfoType(QualType T, TypeSourceInfo *TInfo);
DeclarationName GetNameForDeclarator(Declarator &D);
DeclarationName GetNameFromUnqualifiedId(const UnqualifiedId &Name);
- static QualType GetTypeFromParser(TypeTy *Ty, DeclaratorInfo **DInfo = 0);
+ static QualType GetTypeFromParser(TypeTy *Ty, TypeSourceInfo **TInfo = 0);
bool CheckSpecifiedExceptionType(QualType T, const SourceRange &Range);
bool CheckDistantExceptionSpec(QualType T);
bool CheckEquivalentExceptionSpec(
@@ -596,17 +596,17 @@ public:
SourceLocation NameLoc,
unsigned Diagnostic);
NamedDecl* ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
- QualType R, DeclaratorInfo *DInfo,
+ QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous, bool &Redeclaration);
NamedDecl* ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
- QualType R, DeclaratorInfo *DInfo,
+ QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous,
MultiTemplateParamsArg TemplateParamLists,
bool &Redeclaration);
void CheckVariableDeclaration(VarDecl *NewVD, LookupResult &Previous,
bool &Redeclaration);
NamedDecl* ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
- QualType R, DeclaratorInfo *DInfo,
+ QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous,
MultiTemplateParamsArg TemplateParamLists,
bool IsFunctionDefinition,
@@ -710,7 +710,7 @@ public:
AccessSpecifier AS);
FieldDecl *CheckFieldDecl(DeclarationName Name, QualType T,
- DeclaratorInfo *DInfo,
+ TypeSourceInfo *TInfo,
RecordDecl *Record, SourceLocation Loc,
bool Mutable, Expr *BitfieldWidth,
SourceLocation TSSL,
@@ -823,7 +823,7 @@ public:
/// Subroutines of ActOnDeclarator().
TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
- DeclaratorInfo *DInfo);
+ TypeSourceInfo *TInfo);
void MergeTypeDefDecl(TypedefDecl *New, LookupResult &OldDecls);
bool MergeFunctionDecl(FunctionDecl *New, Decl *Old);
bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old);
@@ -1385,7 +1385,7 @@ public:
StmtArg SynchBody);
VarDecl *BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
- DeclaratorInfo *DInfo,
+ TypeSourceInfo *TInfo,
IdentifierInfo *Name,
SourceLocation Loc,
SourceRange Range);
@@ -1505,7 +1505,7 @@ public:
virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
tok::TokenKind Op, ExprArg Input);
- OwningExprResult CreateSizeOfAlignOfExpr(DeclaratorInfo *T,
+ OwningExprResult CreateSizeOfAlignOfExpr(TypeSourceInfo *T,
SourceLocation OpLoc,
bool isSizeOf, SourceRange R);
OwningExprResult CreateSizeOfAlignOfExpr(Expr *E, SourceLocation OpLoc,
@@ -2131,7 +2131,7 @@ public:
SourceLocation RParenLoc);
MemInitResult BuildBaseInitializer(QualType BaseType,
- DeclaratorInfo *BaseDInfo,
+ TypeSourceInfo *BaseTInfo,
Expr **Args, unsigned NumArgs,
SourceLocation LParenLoc,
SourceLocation RParenLoc,
@@ -2496,7 +2496,7 @@ public:
TemplateArgumentListBuilder &Converted);
bool CheckTemplateArgument(TemplateTypeParmDecl *Param,
- DeclaratorInfo *Arg);
+ TypeSourceInfo *Arg);
bool CheckTemplateArgumentAddressOfObjectOrFunction(Expr *Arg,
NamedDecl *&Entity);
bool CheckTemplateArgumentPointerToMember(Expr *Arg,
@@ -3128,7 +3128,7 @@ public:
void PerformPendingImplicitInstantiations();
- DeclaratorInfo *SubstType(DeclaratorInfo *T,
+ TypeSourceInfo *SubstType(TypeSourceInfo *T,
const MultiLevelTemplateArgumentList &TemplateArgs,
SourceLocation Loc, DeclarationName Entity);
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 01314c31cf..a5314bb075 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -588,7 +588,7 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid,
FunctionDecl *New = FunctionDecl::Create(Context,
Context.getTranslationUnitDecl(),
- Loc, II, R, /*DInfo=*/0,
+ Loc, II, R, /*TInfo=*/0,
FunctionDecl::Extern, false,
/*hasPrototype=*/true);
New->setImplicit();
@@ -599,7 +599,7 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid,
llvm::SmallVector<ParmVarDecl*, 16> Params;
for (unsigned i = 0, e = FT->getNumArgs(); i != e; ++i)
Params.push_back(ParmVarDecl::Create(Context, New, SourceLocation(), 0,
- FT->getArgType(i), /*DInfo=*/0,
+ FT->getArgType(i), /*TInfo=*/0,
VarDecl::None, 0));
New->setParams(Context, Params.data(), Params.size());
}
@@ -924,7 +924,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
ParamType != ParamEnd; ++ParamType) {
ParmVarDecl *Param = ParmVarDecl::Create(Context, New,
SourceLocation(), 0,
- *ParamType, /*DInfo=*/0,
+ *ParamType, /*TInfo=*/0,
VarDecl::None, 0);
Param->setImplicit();
Params.push_back(Param);
@@ -1678,9 +1678,9 @@ Sema::DeclPtrTy Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
// Mock up a declarator.
Declarator Dc(DS, Declarator::TypeNameContext);
- DeclaratorInfo *DInfo = 0;
- GetTypeForDeclarator(Dc, S, &DInfo);
- assert(DInfo && "couldn't build declarator info for anonymous struct/union");
+ TypeSourceInfo *TInfo = 0;
+ GetTypeForDeclarator(Dc, S, &TInfo);
+ assert(TInfo && "couldn't build declarator info for anonymous struct/union");
// Create a declaration for this anonymous struct/union.
NamedDecl *Anon = 0;
@@ -1688,7 +1688,7 @@ Sema::DeclPtrTy Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
Anon = FieldDecl::Create(Context, OwningClass, Record->getLocation(),
/*IdentifierInfo=*/0,
Context.getTypeDeclType(Record),
- DInfo,
+ TInfo,
/*BitWidth=*/0, /*Mutable=*/false);
Anon->setAccess(AS_public);
if (getLangOptions().CPlusPlus)
@@ -1715,7 +1715,7 @@ Sema::DeclPtrTy Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
Anon = VarDecl::Create(Context, Owner, Record->getLocation(),
/*IdentifierInfo=*/0,
Context.getTypeDeclType(Record),
- DInfo,
+ TInfo,
SC);
}
Anon->setImplicit();
@@ -1876,8 +1876,8 @@ Sema::HandleDeclarator(Scope *S, Declarator &D,
DeclContext *DC;
NamedDecl *New;
- DeclaratorInfo *DInfo = 0;
- QualType R = GetTypeForDeclarator(D, S, &DInfo);
+ TypeSourceInfo *TInfo = 0;
+ QualType R = GetTypeForDeclarator(D, S, &TInfo);
LookupResult Previous(*this, Name, D.getIdentifierLoc(), LookupOrdinaryName,
ForRedeclaration);
@@ -2007,13 +2007,13 @@ Sema::HandleDeclarator(Scope *S, Declarator &D,
return DeclPtrTy();
}
- New = ActOnTypedefDeclarator(S, D, DC, R, DInfo, Previous, Redeclaration);
+ New = ActOnTypedefDeclarator(S, D, DC, R, TInfo, Previous, Redeclaration);
} else if (R->isFunctionType()) {
- New = ActOnFunctionDeclarator(S, D, DC, R, DInfo, Previous,
+ New = ActOnFunctionDeclarator(S, D, DC, R, TInfo, Previous,
move(TemplateParamLists),
IsFunctionDefinition, Redeclaration);
} else {
- New = ActOnVariableDeclarator(S, D, DC, R, DInfo, Previous,
+ New = ActOnVariableDeclarator(S, D, DC, R, TInfo, Previous,
move(TemplateParamLists),
Redeclaration);
}
@@ -2129,7 +2129,7 @@ void Sema::DiagnoseFunctionSpecifiers(Declarator& D) {
NamedDecl*
Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
- QualType R, DeclaratorInfo *DInfo,
+ QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous, bool &Redeclaration) {
// Typedef declarators cannot be qualified (C++ [dcl.meaning]p1).
if (D.getCXXScopeSpec().isSet()) {
@@ -2150,7 +2150,7 @@ Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
if (D.getDeclSpec().isThreadSpecified())
Diag(D.getDeclSpec().getThreadSpecLoc(), diag::err_invalid_thread);
- TypedefDecl *NewTD = ParseTypedefDecl(S, D, R, DInfo);
+ TypedefDecl *NewTD = ParseTypedefDecl(S, D, R, TInfo);
if (!NewTD) return 0;
// Handle attributes prior to checking for duplicates in MergeVarDecl
@@ -2176,7 +2176,7 @@ Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
TryToFixInvalidVariablyModifiedType(T, Context, SizeIsNegative);
if (!FixedTy.isNull()) {
Diag(D.getIdentifierLoc(), diag::warn_illegal_constant_array_size);
- NewTD->setTypeDeclaratorInfo(Context.getTrivialDeclaratorInfo(FixedTy));
+ NewTD->setTypeSourceInfo(Context.getTrivialTypeSourceInfo(FixedTy));
} else {
if (SizeIsNegative)
Diag(D.getIdentifierLoc(), diag::err_typecheck_negative_array_size);
@@ -2269,7 +2269,7 @@ isOutOfScopePreviousDeclaration(NamedDecl *PrevDecl, DeclContext *DC,
NamedDecl*
Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
- QualType R, DeclaratorInfo *DInfo,
+ QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous,
MultiTemplateParamsArg TemplateParamLists,
bool &Redeclaration) {
@@ -2371,7 +2371,7 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
}
NewVD = VarDecl::Create(Context, DC, D.getIdentifierLoc(),
- II, R, DInfo, SC);
+ II, R, TInfo, SC);
if (D.isInvalidType())
NewVD->setInvalidDecl();
@@ -2623,7 +2623,7 @@ void Sema::AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD) {
NamedDecl*
Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
- QualType R, DeclaratorInfo *DInfo,
+ QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous,
MultiTemplateParamsArg TemplateParamLists,
bool IsFunctionDefinition, bool &Redeclaration) {
@@ -2705,7 +2705,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// Create the new declaration
NewFD = CXXConstructorDecl::Create(Context,
cast<CXXRecordDecl>(DC),
- D.getIdentifierLoc(), Name, R, DInfo,
+ D.getIdentifierLoc(), Name, R, TInfo,
isExplicit, isInline,
/*isImplicitlyDeclared=*/false);
} else if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
@@ -2726,7 +2726,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// Create a FunctionDecl to satisfy the function definition parsing
// code path.
NewFD = FunctionDecl::Create(Context, DC, D.getIdentifierLoc(),
- Name, R, DInfo, SC, isInline,
+ Name, R, TInfo, SC, isInline,
/*hasPrototype=*/true);
D.setInvalidType();
}
@@ -2739,7 +2739,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
CheckConversionDeclarator(D, R, SC);
NewFD = CXXConversionDecl::Create(Context, cast<CXXRecordDecl>(DC),
- D.getIdentifierLoc(), Name, R, DInfo,
+ D.getIdentifierLoc(), Name, R, TInfo,
isInline, isExplicit);
isVirtualOkay = true;
@@ -2773,7 +2773,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// This is a C++ method declaration.
NewFD = CXXMethodDecl::Create(Context, cast<CXXRecordDecl>(DC),
- D.getIdentifierLoc(), Name, R, DInfo,
+ D.getIdentifierLoc(), Name, R, TInfo,
isStatic, isInline);
isVirtualOkay = !isStatic;
@@ -2791,7 +2791,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
NewFD = FunctionDecl::Create(Context, DC,
D.getIdentifierLoc(),
- Name, R, DInfo, SC, isInline, HasPrototype);
+ Name, R, TInfo, SC, isInline, HasPrototype);
}
if (D.isInvalidType())
@@ -2946,7 +2946,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
AE = FT->arg_type_end(); AI != AE; ++AI) {
ParmVarDecl *Param = ParmVarDecl::Create(Context, DC,
SourceLocation(), 0,
- *AI, /*DInfo=*/0,
+ *AI, /*TInfo=*/0,
VarDecl::None, 0);
Param->setImplicit();
Params.push_back(Param);
@@ -3841,9 +3841,9 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
if (getLangOptions().CPlusPlus)
CheckExtraCXXDefaultArguments(D);
- DeclaratorInfo *DInfo = 0;
+ TypeSourceInfo *TInfo = 0;
TagDecl *OwnedDecl = 0;
- QualType parmDeclType = GetTypeForDeclarator(D, S, &DInfo, &OwnedDecl);
+ QualType parmDeclType = GetTypeForDeclarator(D, S, &TInfo, &OwnedDecl);
if (getLangOptions().CPlusPlus && OwnedDecl && OwnedDecl->isDefinition()) {
// C++ [dcl.fct]p6:
@@ -3886,7 +3886,7 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
ParmVarDecl *New
= ParmVarDecl::Create(Context, CurContext, D.getIdentifierLoc(), II,
- T, DInfo, StorageClass, 0);
+ T, TInfo, StorageClass, 0);
if (D.isInvalidType())
New->setInvalidDecl();
@@ -4329,20 +4329,20 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) {
}
TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
- DeclaratorInfo *DInfo) {
+ TypeSourceInfo *TInfo) {
assert(D.getIdentifier() && "Wrong callback for declspec without declarator");
assert(!T.isNull() && "GetTypeForDeclarator() returned null type");
- if (!DInfo) {
+ if (!TInfo) {
assert(D.isInvalidType() && "no declarator info for valid type");
- DInfo = Context.getTrivialDeclaratorInfo(T);
+ TInfo = Context.getTrivialTypeSourceInfo(T);
}
// Scope manipulation handled by caller.
TypedefDecl *NewTD = TypedefDecl::Create(Context, CurContext,
D.getIdentifierLoc(),
D.getIdentifier(),
- DInfo);
+ TInfo);
if (const TagType *TT = T->getAs<TagType>()) {
TagDecl *TD = TT->getDecl();
@@ -4976,8 +4976,8 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
SourceLocation Loc = DeclStart;
if (II) Loc = D.getIdentifierLoc();
- DeclaratorInfo *DInfo = 0;
- QualType T = GetTypeForDeclarator(D, S, &DInfo);
+ TypeSourceInfo *TInfo = 0;
+ QualType T = GetTypeForDeclarator(D, S, &TInfo);
if (getLangOptions().CPlusPlus)
CheckExtraCXXDefaultArguments(D);
@@ -5003,7 +5003,7 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
= (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_mutable);
SourceLocation TSSL = D.getSourceRange().getBegin();
FieldDecl *NewFD
- = CheckFieldDecl(II, T, DInfo, Record, Loc, Mutable, BitWidth, TSSL,
+ = CheckFieldDecl(II, T, TInfo, Record, Loc, Mutable, BitWidth, TSSL,
AS, PrevDecl, &D);
if (NewFD->isInvalidDecl() && PrevDecl) {
// Don't introduce NewFD into scope; there's already something
@@ -5027,7 +5027,7 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
///
/// \todo The Declarator argument is a hack. It will be removed once
FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
- DeclaratorInfo *DInfo,
+ TypeSourceInfo *TInfo,
RecordDecl *Record, SourceLocation Loc,
bool Mutable, Expr *BitWidth,
SourceLocation TSSL,
@@ -5083,7 +5083,7 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
ZeroWidth = false;
}
- FieldDecl *NewFD = FieldDecl::Create(Context, Record, Loc, II, T, DInfo,
+ FieldDecl *NewFD = FieldDecl::Create(Context, Record, Loc, II, T, TInfo,
BitWidth, Mutable);
if (InvalidDecl)
NewFD->setInvalidDecl();
@@ -5330,8 +5330,8 @@ Sema::DeclPtrTy Sema::ActOnIvar(Scope *S,
// FIXME: Unnamed fields can be handled in various different ways, for
// example, unnamed unions inject all members into the struct namespace!
- DeclaratorInfo *DInfo = 0;
- QualType T = GetTypeForDeclarator(D, S, &DInfo);
+ TypeSourceInfo *TInfo = 0;
+ QualType T = GetTypeForDeclarator(D, S, &TInfo);
if (BitWidth) {
// 6.7.2.1p3, 6.7.2.1p4
@@ -5374,7 +5374,7 @@ Sema::DeclPtrTy Sema::ActOnIvar(Scope *S,
// Construct the decl.
ObjCIvarDecl *NewID = ObjCIvarDecl::Create(Context,
EnclosingContext, Loc, II, T,
- DInfo, ac, (Expr *)BitfieldWidth);
+ TInfo, ac, (Expr *)BitfieldWidth);
if (II) {
NamedDecl *PrevDecl = LookupSingleName(S, II, LookupMemberName,
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 2e641d9041..23dccdf62e 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -195,7 +195,7 @@ static void HandleExtVectorTypeAttr(Scope *scope, Decl *d,
QualType T = S.BuildExtVectorType(curType, S.Owned(sizeExpr), Attr.getLoc());
if (!T.isNull()) {
// FIXME: preserve the old source info.
- tDecl->setTypeDeclaratorInfo(S.Context.getTrivialDeclaratorInfo(T));
+ tDecl->setTypeSourceInfo(S.Context.getTrivialTypeSourceInfo(T));
// Remember this typedef decl, we will need it later for diagnostics.
S.ExtVectorDecls.push_back(tDecl);
@@ -1624,7 +1624,7 @@ static void HandleModeAttr(Decl *D, const AttributeList &Attr, Sema &S) {
// Install the new type.
if (TypedefDecl *TD = dyn_cast<TypedefDecl>(D)) {
// FIXME: preserve existing source info.
- TD->setTypeDeclaratorInfo(S.Context.getTrivialDeclaratorInfo(NewTy));
+ TD->setTypeSourceInfo(S.Context.getTrivialTypeSourceInfo(NewTy));
} else
cast<ValueDecl>(D)->setType(NewTy);
}
@@ -1977,11 +1977,11 @@ NamedDecl * Sema::DeclClonePragmaWeak(NamedDecl *ND, IdentifierInfo *II) {
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(ND)) {
NewD = FunctionDecl::Create(FD->getASTContext(), FD->getDeclContext(),
FD->getLocation(), DeclarationName(II),
- FD->getType(), FD->getDeclaratorInfo());
+ FD->getType(), FD->getTypeSourceInfo());
} else if (VarDecl *VD = dyn_cast<VarDecl>(ND)) {
NewD = VarDecl::Create(VD->getASTContext(), VD->getDeclContext(),
VD->getLocation(), II,
- VD->getType(), VD->getDeclaratorInfo(),
+ VD->getType(), VD->getTypeSourceInfo(),
VD->getStorageClass());
}
return NewD;
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index e115095566..2df172e76e 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -1000,9 +1000,9 @@ Sema::ActOnMemInitializer(DeclPtrTy ConstructorD,
// It didn't name a member, so see if it names a class.
QualType BaseType;
- DeclaratorInfo *DInfo = 0;
+ TypeSourceInfo *TInfo = 0;
if (TemplateTypeTy)
- BaseType = GetTypeFromParser(TemplateTypeTy, &DInfo);
+ BaseType = GetTypeFromParser(TemplateTypeTy, &TInfo);
else
BaseType = QualType::getFromOpaquePtr(getTypeName(*MemberOrBase, IdLoc,
S, &SS));
@@ -1010,10 +1010,10 @@ Sema::ActOnMemInitializer(DeclPtrTy ConstructorD,
return Diag(IdLoc, diag::err_mem_init_not_member_or_class)
<< MemberOrBase << SourceRange(IdLoc, RParenLoc);
- if (!DInfo)
- DInfo = Context.getTrivialDeclaratorInfo(BaseType, IdLoc);
+ if (!TInfo)
+ TInfo = Context.getTrivialTypeSourceInfo(BaseType, IdLoc);
- return BuildBaseInitializer(BaseType, DInfo, (Expr **)Args, NumArgs,
+ return BuildBaseInitializer(BaseType, TInfo, (Expr **)Args, NumArgs,
LParenLoc, RParenLoc, ClassDecl);
}
@@ -1151,7 +1151,7 @@ Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args,
}
Sema::MemInitResult
-Sema::BuildBaseInitializer(QualType BaseType, DeclaratorInfo *BaseDInfo,
+Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo,
Expr **Args, unsigned NumArgs,
SourceLocation LParenLoc, SourceLocation RParenLoc,
CXXRecordDecl *ClassDecl) {
@@ -1159,11 +1159,11 @@ Sema::BuildBaseInitializer(QualType BaseType, DeclaratorInfo *BaseDInfo,
for (unsigned i = 0; i < NumArgs; i++)
HasDependentArg |= Args[i]->isTypeDependent();
- SourceLocation BaseLoc = BaseDInfo->getTypeLoc().getSourceRange().getBegin();
+ SourceLocation BaseLoc = BaseTInfo->getTypeLoc().getSourceRange().getBegin();
if (!BaseType->isDependentType()) {
if (!BaseType->isRecordType())
return Diag(BaseLoc, diag::err_base_init_does_not_name_class)
- << BaseType << BaseDInfo->getTypeLoc().getSourceRange();
+ << BaseType << BaseTInfo->getTypeLoc().getSourceRange();
// C++ [class.base.init]p2:
// [...] Unless the mem-initializer-id names a nonstatic data
@@ -1210,7 +1210,7 @@ Sema::BuildBaseInitializer(QualType BaseType, DeclaratorInfo *BaseDInfo,
// class, the mem-initializer is ill-formed.
if (DirectBaseSpec && VirtualBaseSpec)
return Diag(BaseLoc, diag::err_base_init_direct_and_virtual)
- << BaseType << BaseDInfo->getTypeLoc().getSourceRange();
+ << BaseType << BaseTInfo->getTypeLoc().getSourceRange();
// C++ [base.class.init]p2:
// Unless the mem-initializer-id names a nonstatic data membeer of the
// constructor's class ot a direst or virtual base of that class, the
@@ -1218,7 +1218,7 @@ Sema::BuildBaseInitializer(QualType BaseType, DeclaratorInfo *BaseDInfo,
if (!DirectBaseSpec && !VirtualBaseSpec)
return Diag(BaseLoc, diag::err_not_direct_base_or_virtual)
<< BaseType << ClassDecl->getNameAsCString()
- << BaseDInfo->getTypeLoc().getSourceRange();
+ << BaseTInfo->getTypeLoc().getSourceRange();
}
CXXConstructorDecl *C = 0;
@@ -1245,7 +1245,7 @@ Sema::BuildBaseInitializer(QualType BaseType, DeclaratorInfo *BaseDInfo,
// subexpression so we can wrap it in a CXXExprWithTemporaries if necessary.
ExprTemporaries.clear();
- return new (Context) CXXBaseOrMemberInitializer(Context, BaseDInfo, C,
+ return new (Context) CXXBaseOrMemberInitializer(Context, BaseTInfo, C,
LParenLoc, (Expr **)Args,
NumArgs, RParenLoc);
}
@@ -1336,7 +1336,7 @@ Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
ExprTemporaries.clear();
CXXBaseOrMemberInitializer *Member =
new (Context) CXXBaseOrMemberInitializer(Context,
- Context.getTrivialDeclaratorInfo(VBase->getType(),
+ Context.getTrivialTypeSourceInfo(VBase->getType(),
SourceLocation()),
Ctor,
SourceLocation(),
@@ -1389,7 +1389,7 @@ Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
ExprTemporaries.clear();
CXXBaseOrMemberInitializer *Member =
new (Context) CXXBaseOrMemberInitializer(Context,
- Context.getTrivialDeclaratorInfo(Base->getType(),
+ Context.getTrivialTypeSourceInfo(Base->getType(),
SourceLocation()),
Ctor,
SourceLocation(),
@@ -2032,7 +2032,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
ClassDecl->getLocation(), Name,
Context.getFunctionType(Context.VoidTy,
0, 0, false, 0),
- /*DInfo=*/0,
+ /*TInfo=*/0,
/*isExplicit=*/false,
/*isInline=*/true,
/*isImplicitlyDeclared=*/true);
@@ -2104,7 +2104,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
Context.getFunctionType(Context.VoidTy,
&ArgType, 1,
false, 0),
- /*DInfo=*/0,
+ /*TInfo=*/0,
/*isExplicit=*/false,
/*isInline=*/true,
/*isImplicitlyDeclared=*/true);
@@ -2116,7 +2116,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
ParmVarDecl *FromParam = ParmVarDecl::Create(Context, CopyConstructor,
ClassDecl->getLocation(),
/*IdentifierInfo=*/0,
- ArgType, /*DInfo=*/0,
+ ArgType, /*TInfo=*/0,
VarDecl::None, 0);
CopyConstructor->setParams(Context, &FromParam, 1);
ClassDecl->addDecl(CopyConstructor);
@@ -2190,7 +2190,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
CXXMethodDecl::Create(Context, ClassDecl, ClassDecl->getLocation(), Name,
Context.getFunctionType(RetType, &ArgType, 1,
false, 0),
- /*DInfo=*/0, /*isStatic=*/false, /*isInline=*/true);
+ /*TInfo=*/0, /*isStatic=*/false, /*isInline=*/true);
CopyAssignment->setAccess(AS_public);
CopyAssignment->setImplicit();
CopyAssignment->setTrivial(ClassDecl->hasTrivialCopyAssignment());
@@ -2200,7 +2200,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
ParmVarDecl *FromParam = ParmVarDecl::Create(Context, CopyAssignment,
ClassDecl->getLocation(),
/*IdentifierInfo=*/0,
- ArgType, /*DInfo=*/0,
+ ArgType, /*TInfo=*/0,
VarDecl::None, 0);
CopyAssignment->setParams(Context, &FromParam, 1);
@@ -4436,7 +4436,7 @@ Sema::DeclPtrTy Sema::ActOnFinishLinkageSpecification(Scope *S,
/// occurs within a C++ catch clause, returning the newly-created
/// variable.
VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
- DeclaratorInfo *DInfo,
+ TypeSourceInfo *TInfo,
IdentifierInfo *Name,
SourceLocation Loc,
SourceRange Range) {
@@ -4486,7 +4486,7 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
// FIXME: Need to check for abstract classes.
VarDecl *ExDecl = VarDecl::Create(Context, CurContext, Loc,
- Name, ExDeclType, DInfo, VarDecl::None);
+ Name, ExDeclType, TInfo, VarDecl::None);
if (Invalid)
ExDecl->setInvalidDecl();
@@ -4497,8 +4497,8 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
/// ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch
/// handler.
Sema::DeclPtrTy Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) {
- DeclaratorInfo *DInfo = 0;
- QualType ExDeclType = GetTypeForDeclarator(D, S, &DInfo);
+ TypeSourceInfo *TInfo = 0;
+ QualType ExDeclType = GetTypeForDeclarator(D, S, &TInfo);
bool Invalid = D.isInvalidType();
IdentifierInfo *II = D.getIdentifier();
@@ -4518,7 +4518,7 @@ Sema::DeclPtrTy Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Invalid = true;
}
- VarDecl *ExDecl = BuildExceptionDeclaration(S, ExDeclType, DInfo,
+ VarDecl *ExDecl = BuildExceptionDeclaration(S, ExDeclType, TInfo,
D.getIdentifier(),
D.getIdentifierLoc(),
D.getDeclSpec().getSourceRange());
@@ -4692,8 +4692,8 @@ Sema::ActOnFriendFunctionDecl(Scope *S,
assert(DS.getStorageClassSpec() == DeclSpec::SCS_unspecified);
SourceLocation Loc = D.getIdentifierLoc();
- DeclaratorInfo *DInfo = 0;
- QualType T = GetTypeForDeclarator(D, S, &DInfo);
+ TypeSourceInfo *TInfo = 0;
+ QualType T = GetTypeForDeclarator(D, S, &TInfo);
// C++ [class.friend]p1
// A friend of a class is a function or class....
@@ -4816,7 +4816,7 @@ Sema::ActOnFriendFunctionDecl(Scope *S,
}
bool Redeclaration = f