summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorSaar Raz <saar@raz.email>2019-10-15 18:44:06 +0000
committerSaar Raz <saar@raz.email>2019-10-15 18:44:06 +0000
commit0330fba6e16db9b5d2079313646f93485c5ccf39 (patch)
treecf31f37bd078380eeec9c09cdfbd0bad0fbfadd6 /clang/lib/Serialization/ASTWriter.cpp
parent5836c356fa6e17d0e10a2f9e0e111b7236dc15fb (diff)
downloadbcm5719-llvm-0330fba6e16db9b5d2079313646f93485c5ccf39.tar.gz
bcm5719-llvm-0330fba6e16db9b5d2079313646f93485c5ccf39.zip
[Concept] Associated Constraints Infrastructure
Add code to correctly calculate the associated constraints of a template (no enforcement yet). D41284 on Phabricator. llvm-svn: 374938
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 5e9e650fce8..aef35231163 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -6070,10 +6070,16 @@ void ASTRecordWriter::AddTemplateParameterList(
AddSourceLocation(TemplateParams->getTemplateLoc());
AddSourceLocation(TemplateParams->getLAngleLoc());
AddSourceLocation(TemplateParams->getRAngleLoc());
- // TODO: Concepts
+
Record->push_back(TemplateParams->size());
for (const auto &P : *TemplateParams)
AddDeclRef(P);
+ if (const Expr *RequiresClause = TemplateParams->getRequiresClause()) {
+ Record->push_back(true);
+ AddStmt(const_cast<Expr*>(RequiresClause));
+ } else {
+ Record->push_back(false);
+ }
}
/// Emit a template argument list.
OpenPOWER on IntegriCloud