aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-06-22 09:54:59 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-06-22 09:54:59 +0000
commit44f8c37e378f716e8cbb600e3800f437cf58f9e5 (patch)
treee74d2e26bea14bdbcca1305885d68447856cec76 /lib/Frontend/PCHWriter.cpp
parentd0913557c800c8a712fb554032a833619f23bc56 (diff)
-Introduce PCHReader::ReadTemplateArgumentLoc()
-Introduce PCHWriter::AddTemplateArgumentLocInfo() -Modify PCHWriter::AddTemplateArgumentLoc() to also write TemplateArgumentLoc's TemplateArgument and move the existing calls of AddTemplateArgumentLoc() to AddTemplateArgumentLocInfo(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r--lib/Frontend/PCHWriter.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index a0bd9ec2a7..1fb90851b5 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -428,7 +428,8 @@ void TypeLocWriter::VisitTemplateSpecializationTypeLoc(
Writer.AddSourceLocation(TL.getLAngleLoc(), Record);
Writer.AddSourceLocation(TL.getRAngleLoc(), Record);
for (unsigned i = 0, e = TL.getNumArgs(); i != e; ++i)
- Writer.AddTemplateArgumentLoc(TL.getArgLoc(i), Record);
+ Writer.AddTemplateArgumentLocInfo(TL.getArgLoc(i).getArgument().getKind(),
+ TL.getArgLoc(i).getLocInfo(), Record);
}
void TypeLocWriter::VisitElaboratedTypeLoc(ElaboratedTypeLoc TL) {
Writer.AddSourceLocation(TL.getKeywordLoc(), Record);
@@ -450,7 +451,8 @@ void TypeLocWriter::VisitDependentTemplateSpecializationTypeLoc(
Writer.AddSourceLocation(TL.getLAngleLoc(), Record);
Writer.AddSourceLocation(TL.getRAngleLoc(), Record);
for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I)
- Writer.AddTemplateArgumentLoc(TL.getArgLoc(I), Record);
+ Writer.AddTemplateArgumentLocInfo(TL.getArgLoc(I).getArgument().getKind(),
+ TL.getArgLoc(I).getLocInfo(), Record);
}
void TypeLocWriter::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
@@ -2284,14 +2286,15 @@ void PCHWriter::AddCXXTemporary(const CXXTemporary *Temp, RecordData &Record) {
AddDeclRef(Temp->getDestructor(), Record);
}
-void PCHWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
- RecordData &Record) {
- switch (Arg.getArgument().getKind()) {
+void PCHWriter::AddTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind,
+ const TemplateArgumentLocInfo &Arg,
+ RecordData &Record) {
+ switch (Kind) {
case TemplateArgument::Expression:
- AddStmt(Arg.getLocInfo().getAsExpr());
+ AddStmt(Arg.getAsExpr());
break;
case TemplateArgument::Type:
- AddTypeSourceInfo(Arg.getLocInfo().getAsTypeSourceInfo(), Record);
+ AddTypeSourceInfo(Arg.getAsTypeSourceInfo(), Record);
break;
case TemplateArgument::Template:
Record.push_back(
@@ -2307,6 +2310,13 @@ void PCHWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
}
}
+void PCHWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
+ RecordData &Record) {
+ AddTemplateArgument(Arg.getArgument(), Record);
+ AddTemplateArgumentLocInfo(Arg.getArgument().getKind(), Arg.getLocInfo(),
+ Record);
+}
+
void PCHWriter::AddTypeSourceInfo(TypeSourceInfo *TInfo, RecordData &Record) {
if (TInfo == 0) {
AddTypeRef(QualType(), Record);