summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-07-01 01:24:09 +0000
committerEric Fiselier <eric@efcs.ca>2016-07-01 01:24:09 +0000
commit6ad68551c3fbf780f91a3351e0704a7707fc19cf (patch)
tree58b84fc68050bbe39359d3effbe119c302b6f40e /clang/lib/Serialization
parent762c5ca3ee1441b4d2e5554846be614d871e2eca (diff)
downloadbcm5719-llvm-6ad68551c3fbf780f91a3351e0704a7707fc19cf.tar.gz
bcm5719-llvm-6ad68551c3fbf780f91a3351e0704a7707fc19cf.zip
[Feature] Add a builtin for indexing into parameter packs. Patch by Louis Dionne.
This patch adds a __nth_element builtin that allows fetching the n-th type of a parameter pack with very little compile-time overhead. The patch was inspired by r252036 and r252115 by David Majnemer, which add a similar __make_integer_seq builtin for efficiently creating a std::integer_sequence. Reviewed as D15421. http://reviews.llvm.org/D15421 llvm-svn: 274316
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp3
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 8650ce75769..27ef02f5b06 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -6428,6 +6428,9 @@ static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) {
case PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID:
return Context.getCFConstantStringTagDecl();
+
+ case PREDEF_DECL_TYPE_PACK_ELEMENT_ID:
+ return Context.getTypePackElementDecl();
}
llvm_unreachable("PredefinedDeclIDs unknown enum value");
}
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 4fa016cc896..ef51225b60c 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4191,6 +4191,8 @@ uint64_t ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
PREDEF_DECL_CF_CONSTANT_STRING_ID);
RegisterPredefDecl(Context.CFConstantStringTagDecl,
PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID);
+ RegisterPredefDecl(Context.TypePackElementDecl,
+ PREDEF_DECL_TYPE_PACK_ELEMENT_ID);
// Build a record containing all of the tentative definitions in this file, in
// TentativeDefinitions order. Generally, this record will be empty for
OpenPOWER on IntegriCloud