diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-11-05 01:01:47 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-11-05 01:01:47 +0000 |
commit | 7cdb53900ad540406dd667e03fe3ff037f621d99 (patch) | |
tree | e8bcdcdcc14771732e6f36cf05a26e17ef281978 /lib/Lex/PPMacroExpansion.cpp | |
parent | 72617428e768e273850d5bfdf637d0b63e79b229 (diff) |
[Lex] Add __has_builtin support for __make_integer_seq
Differential Revision: http://reviews.llvm.org/D14349
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPMacroExpansion.cpp')
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index d8d6b0b90d..40b5496ad7 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1636,7 +1636,15 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Value = FeatureII->getTokenID() == tok::identifier; else if (II == Ident__has_builtin) { // Check for a builtin is trivial. - Value = FeatureII->getBuiltinID() != 0; + if (FeatureII->getBuiltinID() != 0) { + Value = true; + } else { + const LangOptions &LangOpts = PP.getLangOpts(); + StringRef Feature = FeatureII->getName(); + Value = llvm::StringSwitch<bool>(Feature) + .Case("__make_integer_seq", LangOpts.CPlusPlus) + .Default(false); + } } else if (II == Ident__has_attribute) Value = hasAttribute(AttrSyntax::GNU, nullptr, FeatureII, getTargetInfo(), getLangOpts()); |