diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-04 21:16:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-04 21:16:09 +0000 |
commit | bd507c5ef3cfe58aa2c0eca901fcd53b45c673a1 (patch) | |
tree | d0cfea2d1ed9dda5d15a0422d744caf58d217713 /lib/Lex | |
parent | b7d09c8606a4b927d563881616a56e32e0589256 (diff) |
Add __has_feature(modules) to indicate when modules are available (in
any language variant), and restrict __has_feature(objc_modules) to
mean that we also have the Objective-C @import syntax. I anticipate
__has_feature(cxx_modules) and/or __has_feature(c_modules) for when we
nail down the module syntax for C/C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index e93dc1560d..76962e4dd7 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -617,7 +617,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { LangOpts.ObjCRuntimeHasWeak) .Case("objc_fixed_enum", LangOpts.ObjC2) .Case("objc_instancetype", LangOpts.ObjC2) - .Case("objc_modules", LangOpts.Modules) + .Case("objc_modules", LangOpts.ObjC2 && LangOpts.Modules) .Case("objc_nonfragile_abi", LangOpts.ObjCNonFragileABI) .Case("objc_weak_class", LangOpts.ObjCNonFragileABI) .Case("ownership_holds", true) @@ -698,6 +698,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("is_trivial", LangOpts.CPlusPlus) .Case("is_trivially_copyable", LangOpts.CPlusPlus) .Case("is_union", LangOpts.CPlusPlus) + .Case("modules", LangOpts.Modules) .Case("tls", PP.getTargetInfo().isTLSSupported()) .Case("underlying_type", LangOpts.CPlusPlus) .Default(false); |