summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
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/Lex/PPMacroExpansion.cpp
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/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index a4734a28124..2ade6df9456 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -1695,6 +1695,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
const LangOptions &LangOpts = getLangOpts();
return llvm::StringSwitch<bool>(II->getName())
.Case("__make_integer_seq", LangOpts.CPlusPlus)
+ .Case("__type_pack_element", LangOpts.CPlusPlus)
.Default(false);
}
});
OpenPOWER on IntegriCloud