forked from OSchip/llvm-project
Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality change.
llvm-svn: 140330
This commit is contained in:
parent
34a1d37ba3
commit
de6aa08013
|
@ -690,7 +690,9 @@ public:
|
|||
|
||||
/// \brief Represents an explicit template argument list in C++, e.g.,
|
||||
/// the "<int>" in "sort<int>".
|
||||
struct ExplicitTemplateArgumentList {
|
||||
/// This is safe to be used inside an AST node, in contrast with
|
||||
/// TemplateArgumentListInfo.
|
||||
struct ASTTemplateArgumentListInfo {
|
||||
/// \brief The source location of the left angle bracket ('<');
|
||||
SourceLocation LAngleLoc;
|
||||
|
||||
|
@ -887,29 +889,29 @@ public:
|
|||
|
||||
/// \brief Retrieve the explicit template argument list that followed the
|
||||
/// member template name.
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs() {
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs() {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
if (hasFoundDecl())
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(
|
||||
&getInternalFoundDecl() + 1);
|
||||
|
||||
if (hasQualifier())
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(
|
||||
&getInternalQualifierLoc() + 1);
|
||||
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(this + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieve the explicit template argument list that followed the
|
||||
/// member template name.
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
return const_cast<DeclRefExpr *>(this)->getExplicitTemplateArgs();
|
||||
}
|
||||
|
||||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getExplicitTemplateArgsOpt() const {
|
||||
const ASTTemplateArgumentListInfo *getExplicitTemplateArgsOpt() const {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -2162,26 +2164,26 @@ public:
|
|||
/// \brief Retrieve the explicit template argument list that
|
||||
/// follow the member template name. This must only be called on an
|
||||
/// expression with explicit template arguments.
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs() {
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs() {
|
||||
assert(HasExplicitTemplateArgumentList);
|
||||
if (!HasQualifierOrFoundDecl)
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(this + 1);
|
||||
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(
|
||||
getMemberQualifier() + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieve the explicit template argument list that
|
||||
/// followed the member template name. This must only be called on
|
||||
/// an expression with explicit template arguments.
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
return const_cast<MemberExpr *>(this)->getExplicitTemplateArgs();
|
||||
}
|
||||
|
||||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getOptionalExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo *getOptionalExplicitTemplateArgs() const {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
|
|
@ -1842,16 +1842,16 @@ public:
|
|||
/// template argument list, e.g. f<int>.
|
||||
bool hasExplicitTemplateArgs() const { return HasExplicitTemplateArgs; }
|
||||
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs(); // defined far below
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs(); // defined far below
|
||||
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
return const_cast<OverloadExpr*>(this)->getExplicitTemplateArgs();
|
||||
}
|
||||
|
||||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getOptionalExplicitTemplateArgs() {
|
||||
const ASTTemplateArgumentListInfo *getOptionalExplicitTemplateArgs() {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -1969,21 +1969,21 @@ public:
|
|||
// nodes, users are *forbidden* from calling these methods on objects
|
||||
// without explicit template arguments.
|
||||
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs() {
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs() {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList*>(this + 1);
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo*>(this + 1);
|
||||
}
|
||||
|
||||
/// Gets a reference to the explicit template argument list.
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
return *reinterpret_cast<const ExplicitTemplateArgumentList*>(this + 1);
|
||||
return *reinterpret_cast<const ASTTemplateArgumentListInfo*>(this + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getOptionalExplicitTemplateArgs() {
|
||||
const ASTTemplateArgumentListInfo *getOptionalExplicitTemplateArgs() {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -2094,21 +2094,21 @@ public:
|
|||
// nodes, users are *forbidden* from calling these methods on objects
|
||||
// without explicit template arguments.
|
||||
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs() {
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs() {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList*>(this + 1);
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo*>(this + 1);
|
||||
}
|
||||
|
||||
/// Gets a reference to the explicit template argument list.
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
return *reinterpret_cast<const ExplicitTemplateArgumentList*>(this + 1);
|
||||
return *reinterpret_cast<const ASTTemplateArgumentListInfo*>(this + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getOptionalExplicitTemplateArgs() {
|
||||
const ASTTemplateArgumentListInfo *getOptionalExplicitTemplateArgs() {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -2470,14 +2470,14 @@ public:
|
|||
|
||||
/// \brief Retrieve the explicit template argument list that followed the
|
||||
/// member template name, if any.
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs() {
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs() {
|
||||
assert(HasExplicitTemplateArgs);
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(this + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieve the explicit template argument list that followed the
|
||||
/// member template name, if any.
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
return const_cast<CXXDependentScopeMemberExpr *>(this)
|
||||
->getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -2485,7 +2485,7 @@ public:
|
|||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getOptionalExplicitTemplateArgs() {
|
||||
const ASTTemplateArgumentListInfo *getOptionalExplicitTemplateArgs() {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -2663,22 +2663,22 @@ public:
|
|||
|
||||
/// \brief Retrieve the explicit template argument list that followed the
|
||||
/// member template name.
|
||||
ExplicitTemplateArgumentList &getExplicitTemplateArgs() {
|
||||
ASTTemplateArgumentListInfo &getExplicitTemplateArgs() {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
return *reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
|
||||
return *reinterpret_cast<ASTTemplateArgumentListInfo *>(this + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieve the explicit template argument list that followed the
|
||||
/// member template name, if any.
|
||||
const ExplicitTemplateArgumentList &getExplicitTemplateArgs() const {
|
||||
const ASTTemplateArgumentListInfo &getExplicitTemplateArgs() const {
|
||||
assert(hasExplicitTemplateArgs());
|
||||
return *reinterpret_cast<const ExplicitTemplateArgumentList *>(this + 1);
|
||||
return *reinterpret_cast<const ASTTemplateArgumentListInfo *>(this + 1);
|
||||
}
|
||||
|
||||
/// \brief Retrieves the optional explicit template arguments.
|
||||
/// This points to the same data as getExplicitTemplateArgs(), but
|
||||
/// returns null if there are no explicit template arguments.
|
||||
const ExplicitTemplateArgumentList *getOptionalExplicitTemplateArgs() {
|
||||
const ASTTemplateArgumentListInfo *getOptionalExplicitTemplateArgs() {
|
||||
if (!hasExplicitTemplateArgs()) return 0;
|
||||
return &getExplicitTemplateArgs();
|
||||
}
|
||||
|
@ -2856,7 +2856,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
inline ExplicitTemplateArgumentList &OverloadExpr::getExplicitTemplateArgs() {
|
||||
inline ASTTemplateArgumentListInfo &OverloadExpr::getExplicitTemplateArgs() {
|
||||
if (isa<UnresolvedLookupExpr>(this))
|
||||
return cast<UnresolvedLookupExpr>(this)->getExplicitTemplateArgs();
|
||||
else
|
||||
|
|
|
@ -130,7 +130,7 @@ SourceLocation Expr::getExprLoc() const {
|
|||
// Primary Expressions.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void ExplicitTemplateArgumentList::initializeFrom(
|
||||
void ASTTemplateArgumentListInfo::initializeFrom(
|
||||
const TemplateArgumentListInfo &Info) {
|
||||
LAngleLoc = Info.getLAngleLoc();
|
||||
RAngleLoc = Info.getRAngleLoc();
|
||||
|
@ -141,7 +141,7 @@ void ExplicitTemplateArgumentList::initializeFrom(
|
|||
new (&ArgBuffer[i]) TemplateArgumentLoc(Info[i]);
|
||||
}
|
||||
|
||||
void ExplicitTemplateArgumentList::initializeFrom(
|
||||
void ASTTemplateArgumentListInfo::initializeFrom(
|
||||
const TemplateArgumentListInfo &Info,
|
||||
bool &Dependent,
|
||||
bool &InstantiationDependent,
|
||||
|
@ -163,7 +163,7 @@ void ExplicitTemplateArgumentList::initializeFrom(
|
|||
}
|
||||
}
|
||||
|
||||
void ExplicitTemplateArgumentList::copyInto(
|
||||
void ASTTemplateArgumentListInfo::copyInto(
|
||||
TemplateArgumentListInfo &Info) const {
|
||||
Info.setLAngleLoc(LAngleLoc);
|
||||
Info.setRAngleLoc(RAngleLoc);
|
||||
|
@ -171,12 +171,12 @@ void ExplicitTemplateArgumentList::copyInto(
|
|||
Info.addArgument(getTemplateArgs()[I]);
|
||||
}
|
||||
|
||||
std::size_t ExplicitTemplateArgumentList::sizeFor(unsigned NumTemplateArgs) {
|
||||
return sizeof(ExplicitTemplateArgumentList) +
|
||||
std::size_t ASTTemplateArgumentListInfo::sizeFor(unsigned NumTemplateArgs) {
|
||||
return sizeof(ASTTemplateArgumentListInfo) +
|
||||
sizeof(TemplateArgumentLoc) * NumTemplateArgs;
|
||||
}
|
||||
|
||||
std::size_t ExplicitTemplateArgumentList::sizeFor(
|
||||
std::size_t ASTTemplateArgumentListInfo::sizeFor(
|
||||
const TemplateArgumentListInfo &Info) {
|
||||
return sizeFor(Info.size());
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ DeclRefExpr *DeclRefExpr::Create(ASTContext &Context,
|
|||
if (FoundD)
|
||||
Size += sizeof(NamedDecl *);
|
||||
if (TemplateArgs)
|
||||
Size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs);
|
||||
Size += ASTTemplateArgumentListInfo::sizeFor(*TemplateArgs);
|
||||
|
||||
void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
|
||||
return new (Mem) DeclRefExpr(QualifierLoc, D, NameInfo, FoundD, TemplateArgs,
|
||||
|
@ -378,7 +378,7 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(ASTContext &Context,
|
|||
if (HasFoundDecl)
|
||||
Size += sizeof(NamedDecl *);
|
||||
if (HasExplicitTemplateArgs)
|
||||
Size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs);
|
||||
Size += ASTTemplateArgumentListInfo::sizeFor(NumTemplateArgs);
|
||||
|
||||
void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
|
||||
return new (Mem) DeclRefExpr(EmptyShell());
|
||||
|
@ -952,7 +952,7 @@ MemberExpr *MemberExpr::Create(ASTContext &C, Expr *base, bool isarrow,
|
|||
Size += sizeof(MemberNameQualifier);
|
||||
|
||||
if (targs)
|
||||
Size += ExplicitTemplateArgumentList::sizeFor(*targs);
|
||||
Size += ASTTemplateArgumentListInfo::sizeFor(*targs);
|
||||
|
||||
void *Mem = C.Allocate(Size, llvm::alignOf<MemberExpr>());
|
||||
MemberExpr *E = new (Mem) MemberExpr(base, isarrow, memberdecl, nameinfo,
|
||||
|
|
|
@ -202,7 +202,7 @@ UnresolvedLookupExpr::Create(ASTContext &C,
|
|||
UnresolvedSetIterator End)
|
||||
{
|
||||
void *Mem = C.Allocate(sizeof(UnresolvedLookupExpr) +
|
||||
ExplicitTemplateArgumentList::sizeFor(Args));
|
||||
ASTTemplateArgumentListInfo::sizeFor(Args));
|
||||
return new (Mem) UnresolvedLookupExpr(C, NamingClass, QualifierLoc, NameInfo,
|
||||
ADL, /*Overload*/ true, &Args,
|
||||
Begin, End, /*StdIsAssociated=*/false);
|
||||
|
@ -213,7 +213,7 @@ UnresolvedLookupExpr::CreateEmpty(ASTContext &C, bool HasExplicitTemplateArgs,
|
|||
unsigned NumTemplateArgs) {
|
||||
std::size_t size = sizeof(UnresolvedLookupExpr);
|
||||
if (HasExplicitTemplateArgs)
|
||||
size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs);
|
||||
size += ASTTemplateArgumentListInfo::sizeFor(NumTemplateArgs);
|
||||
|
||||
void *Mem = C.Allocate(size, llvm::alignOf<UnresolvedLookupExpr>());
|
||||
UnresolvedLookupExpr *E = new (Mem) UnresolvedLookupExpr(EmptyShell());
|
||||
|
@ -332,7 +332,7 @@ DependentScopeDeclRefExpr::DependentScopeDeclRefExpr(QualType T,
|
|||
bool ContainsUnexpandedParameterPack
|
||||
= ExprBits.ContainsUnexpandedParameterPack;
|
||||
|
||||
reinterpret_cast<ExplicitTemplateArgumentList*>(this+1)
|
||||
reinterpret_cast<ASTTemplateArgumentListInfo*>(this+1)
|
||||
->initializeFrom(*Args, Dependent, InstantiationDependent,
|
||||
ContainsUnexpandedParameterPack);
|
||||
|
||||
|
@ -347,7 +347,7 @@ DependentScopeDeclRefExpr::Create(ASTContext &C,
|
|||
const TemplateArgumentListInfo *Args) {
|
||||
std::size_t size = sizeof(DependentScopeDeclRefExpr);
|
||||
if (Args)
|
||||
size += ExplicitTemplateArgumentList::sizeFor(*Args);
|
||||
size += ASTTemplateArgumentListInfo::sizeFor(*Args);
|
||||
void *Mem = C.Allocate(size);
|
||||
return new (Mem) DependentScopeDeclRefExpr(C.DependentTy, QualifierLoc,
|
||||
NameInfo, Args);
|
||||
|
@ -359,7 +359,7 @@ DependentScopeDeclRefExpr::CreateEmpty(ASTContext &C,
|
|||
unsigned NumTemplateArgs) {
|
||||
std::size_t size = sizeof(DependentScopeDeclRefExpr);
|
||||
if (HasExplicitTemplateArgs)
|
||||
size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs);
|
||||
size += ASTTemplateArgumentListInfo::sizeFor(NumTemplateArgs);
|
||||
void *Mem = C.Allocate(size);
|
||||
DependentScopeDeclRefExpr *E
|
||||
= new (Mem) DependentScopeDeclRefExpr(QualType(), NestedNameSpecifierLoc(),
|
||||
|
@ -838,7 +838,7 @@ CXXDependentScopeMemberExpr::Create(ASTContext &C,
|
|||
|
||||
std::size_t size = sizeof(CXXDependentScopeMemberExpr);
|
||||
if (TemplateArgs)
|
||||
size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs);
|
||||
size += ASTTemplateArgumentListInfo::sizeFor(*TemplateArgs);
|
||||
|
||||
void *Mem = C.Allocate(size, llvm::alignOf<CXXDependentScopeMemberExpr>());
|
||||
return new (Mem) CXXDependentScopeMemberExpr(C, Base, BaseType,
|
||||
|
@ -859,7 +859,7 @@ CXXDependentScopeMemberExpr::CreateEmpty(ASTContext &C,
|
|||
DeclarationNameInfo());
|
||||
|
||||
std::size_t size = sizeof(CXXDependentScopeMemberExpr) +
|
||||
ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs);
|
||||
ASTTemplateArgumentListInfo::sizeFor(NumTemplateArgs);
|
||||
void *Mem = C.Allocate(size, llvm::alignOf<CXXDependentScopeMemberExpr>());
|
||||
CXXDependentScopeMemberExpr *E
|
||||
= new (Mem) CXXDependentScopeMemberExpr(C, 0, QualType(),
|
||||
|
@ -947,7 +947,7 @@ UnresolvedMemberExpr::Create(ASTContext &C,
|
|||
UnresolvedSetIterator End) {
|
||||
std::size_t size = sizeof(UnresolvedMemberExpr);
|
||||
if (TemplateArgs)
|
||||
size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs);
|
||||
size += ASTTemplateArgumentListInfo::sizeFor(*TemplateArgs);
|
||||
|
||||
void *Mem = C.Allocate(size, llvm::alignOf<UnresolvedMemberExpr>());
|
||||
return new (Mem) UnresolvedMemberExpr(C,
|
||||
|
@ -961,7 +961,7 @@ UnresolvedMemberExpr::CreateEmpty(ASTContext &C, bool HasExplicitTemplateArgs,
|
|||
unsigned NumTemplateArgs) {
|
||||
std::size_t size = sizeof(UnresolvedMemberExpr);
|
||||
if (HasExplicitTemplateArgs)
|
||||
size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs);
|
||||
size += ASTTemplateArgumentListInfo::sizeFor(NumTemplateArgs);
|
||||
|
||||
void *Mem = C.Allocate(size, llvm::alignOf<UnresolvedMemberExpr>());
|
||||
UnresolvedMemberExpr *E = new (Mem) UnresolvedMemberExpr(EmptyShell());
|
||||
|
|
|
@ -310,7 +310,7 @@ private:
|
|||
void mangleCXXCtorType(CXXCtorType T);
|
||||
void mangleCXXDtorType(CXXDtorType T);
|
||||
|
||||
void mangleTemplateArgs(const ExplicitTemplateArgumentList &TemplateArgs);
|
||||
void mangleTemplateArgs(const ASTTemplateArgumentListInfo &TemplateArgs);
|
||||
void mangleTemplateArgs(TemplateName Template,
|
||||
const TemplateArgument *TemplateArgs,
|
||||
unsigned NumTemplateArgs);
|
||||
|
@ -2817,7 +2817,7 @@ void CXXNameMangler::mangleCXXDtorType(CXXDtorType T) {
|
|||
}
|
||||
|
||||
void CXXNameMangler::mangleTemplateArgs(
|
||||
const ExplicitTemplateArgumentList &TemplateArgs) {
|
||||
const ASTTemplateArgumentListInfo &TemplateArgs) {
|
||||
// <template-args> ::= I <template-arg>+ E
|
||||
Out << 'I';
|
||||
for (unsigned i = 0, e = TemplateArgs.NumTemplateArgs; i != e; ++i)
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace clang {
|
|||
static const unsigned NumExprFields = NumStmtFields + 7;
|
||||
|
||||
/// \brief Read and initialize a ExplicitTemplateArgumentList structure.
|
||||
void ReadExplicitTemplateArgumentList(ExplicitTemplateArgumentList &ArgList,
|
||||
void ReadExplicitTemplateArgumentList(ASTTemplateArgumentListInfo &ArgList,
|
||||
unsigned NumTemplateArgs);
|
||||
|
||||
void VisitStmt(Stmt *S);
|
||||
|
@ -91,7 +91,7 @@ namespace clang {
|
|||
}
|
||||
|
||||
void ASTStmtReader::
|
||||
ReadExplicitTemplateArgumentList(ExplicitTemplateArgumentList &ArgList,
|
||||
ReadExplicitTemplateArgumentList(ASTTemplateArgumentListInfo &ArgList,
|
||||
unsigned NumTemplateArgs) {
|
||||
TemplateArgumentListInfo ArgInfo;
|
||||
ArgInfo.setLAngleLoc(ReadSourceLocation(Record, Idx));
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace clang {
|
|||
: Writer(Writer), Record(Record) { }
|
||||
|
||||
void
|
||||
AddExplicitTemplateArgumentList(const ExplicitTemplateArgumentList &Args);
|
||||
AddExplicitTemplateArgumentList(const ASTTemplateArgumentListInfo &Args);
|
||||
|
||||
void VisitStmt(Stmt *S);
|
||||
#define STMT(Type, Base) \
|
||||
|
@ -46,7 +46,7 @@ namespace clang {
|
|||
}
|
||||
|
||||
void ASTStmtWriter::
|
||||
AddExplicitTemplateArgumentList(const ExplicitTemplateArgumentList &Args) {
|
||||
AddExplicitTemplateArgumentList(const ASTTemplateArgumentListInfo &Args) {
|
||||
Writer.AddSourceLocation(Args.LAngleLoc, Record);
|
||||
Writer.AddSourceLocation(Args.RAngleLoc, Record);
|
||||
for (unsigned i=0; i != Args.NumTemplateArgs; ++i)
|
||||
|
@ -1142,7 +1142,7 @@ ASTStmtWriter::VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E){
|
|||
|
||||
Record.push_back(E->hasExplicitTemplateArgs());
|
||||
if (E->hasExplicitTemplateArgs()) {
|
||||
const ExplicitTemplateArgumentList &Args = E->getExplicitTemplateArgs();
|
||||
const ASTTemplateArgumentListInfo &Args = E->getExplicitTemplateArgs();
|
||||
Record.push_back(Args.NumTemplateArgs);
|
||||
AddExplicitTemplateArgumentList(Args);
|
||||
}
|
||||
|
@ -1168,7 +1168,7 @@ ASTStmtWriter::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E) {
|
|||
// emitted first.
|
||||
Record.push_back(E->hasExplicitTemplateArgs());
|
||||
if (E->hasExplicitTemplateArgs()) {
|
||||
const ExplicitTemplateArgumentList &Args = E->getExplicitTemplateArgs();
|
||||
const ASTTemplateArgumentListInfo &Args = E->getExplicitTemplateArgs();
|
||||
Record.push_back(Args.NumTemplateArgs);
|
||||
AddExplicitTemplateArgumentList(Args);
|
||||
}
|
||||
|
@ -1197,7 +1197,7 @@ void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
|
|||
// Don't emit anything here, hasExplicitTemplateArgs() must be emitted first.
|
||||
Record.push_back(E->hasExplicitTemplateArgs());
|
||||
if (E->hasExplicitTemplateArgs()) {
|
||||
const ExplicitTemplateArgumentList &Args = E->getExplicitTemplateArgs();
|
||||
const ASTTemplateArgumentListInfo &Args = E->getExplicitTemplateArgs();
|
||||
Record.push_back(Args.NumTemplateArgs);
|
||||
AddExplicitTemplateArgumentList(Args);
|
||||
}
|
||||
|
|
|
@ -1622,7 +1622,7 @@ DEF_JOB(StmtVisit, Stmt, StmtVisitKind)
|
|||
DEF_JOB(MemberExprParts, MemberExpr, MemberExprPartsKind)
|
||||
DEF_JOB(DeclRefExprParts, DeclRefExpr, DeclRefExprPartsKind)
|
||||
DEF_JOB(OverloadExprParts, OverloadExpr, OverloadExprPartsKind)
|
||||
DEF_JOB(ExplicitTemplateArgsVisit, ExplicitTemplateArgumentList,
|
||||
DEF_JOB(ExplicitTemplateArgsVisit, ASTTemplateArgumentListInfo,
|
||||
ExplicitTemplateArgsVisitKind)
|
||||
DEF_JOB(SizeOfPackExprParts, SizeOfPackExpr, SizeOfPackExprPartsKind)
|
||||
#undef DEF_JOB
|
||||
|
@ -1769,7 +1769,7 @@ public:
|
|||
private:
|
||||
void AddDeclarationNameInfo(Stmt *S);
|
||||
void AddNestedNameSpecifierLoc(NestedNameSpecifierLoc Qualifier);
|
||||
void AddExplicitTemplateArgs(const ExplicitTemplateArgumentList *A);
|
||||
void AddExplicitTemplateArgs(const ASTTemplateArgumentListInfo *A);
|
||||
void AddMemberRef(FieldDecl *D, SourceLocation L);
|
||||
void AddStmt(Stmt *S);
|
||||
void AddDecl(Decl *D, bool isFirst = true);
|
||||
|
@ -1799,10 +1799,10 @@ void EnqueueVisitor::AddDecl(Decl *D, bool isFirst) {
|
|||
WL.push_back(DeclVisit(D, Parent, isFirst));
|
||||
}
|
||||
void EnqueueVisitor::
|
||||
AddExplicitTemplateArgs(const ExplicitTemplateArgumentList *A) {
|
||||
AddExplicitTemplateArgs(const ASTTemplateArgumentListInfo *A) {
|
||||
if (A)
|
||||
WL.push_back(ExplicitTemplateArgsVisit(
|
||||
const_cast<ExplicitTemplateArgumentList*>(A), Parent));
|
||||
const_cast<ASTTemplateArgumentListInfo*>(A), Parent));
|
||||
}
|
||||
void EnqueueVisitor::AddMemberRef(FieldDecl *D, SourceLocation L) {
|
||||
if (D)
|
||||
|
@ -2101,7 +2101,7 @@ bool CursorVisitor::RunVisitorWorkList(VisitorWorkList &WL) {
|
|||
continue;
|
||||
}
|
||||
case VisitorJob::ExplicitTemplateArgsVisitKind: {
|
||||
const ExplicitTemplateArgumentList *ArgList =
|
||||
const ASTTemplateArgumentListInfo *ArgList =
|
||||
cast<ExplicitTemplateArgsVisit>(&LI)->get();
|
||||
for (const TemplateArgumentLoc *Arg = ArgList->getTemplateArgs(),
|
||||
*ArgEnd = Arg + ArgList->NumTemplateArgs;
|
||||
|
@ -2264,7 +2264,7 @@ typedef llvm::SmallVector<SourceRange, 4> RefNamePieces;
|
|||
RefNamePieces buildPieces(unsigned NameFlags, bool IsMemberRefExpr,
|
||||
const DeclarationNameInfo &NI,
|
||||
const SourceRange &QLoc,
|
||||
const ExplicitTemplateArgumentList *TemplateArgs = 0){
|
||||
const ASTTemplateArgumentListInfo *TemplateArgs = 0){
|
||||
const bool WantQualifier = NameFlags & CXNameRange_WantQualifier;
|
||||
const bool WantTemplateArgs = NameFlags & CXNameRange_WantTemplateArgs;
|
||||
const bool WantSinglePiece = NameFlags & CXNameRange_WantSinglePiece;
|
||||
|
|
Loading…
Reference in New Issue