r345637 - NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)
Erik Pilkington via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 30 13:31:30 PDT 2018
Author: epilk
Date: Tue Oct 30 13:31:30 2018
New Revision: 345637
URL: http://llvm.org/viewvc/llvm-project?rev=345637&view=rev
Log:
NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)
We haven't supported compiling ObjC1 for a long time (and never will again), so
there isn't any reason to keep these separate. This patch replaces
LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC.
Differential revision: https://reviews.llvm.org/D53547
Modified:
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/include/clang/Basic/Features.def
cfe/trunk/include/clang/Basic/LangOptions.def
cfe/trunk/include/clang/Basic/TokenKinds.def
cfe/trunk/include/clang/Basic/TokenKinds.h
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/lib/ARCMigrate/ARCMT.cpp
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/AST/NSAPI.cpp
cfe/trunk/lib/Analysis/FormatString.cpp
cfe/trunk/lib/Basic/Builtins.cpp
cfe/trunk/lib/Basic/IdentifierTable.cpp
cfe/trunk/lib/Basic/Module.cpp
cfe/trunk/lib/Basic/Targets/OSTargets.cpp
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/FrontendAction.cpp
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp
cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp
cfe/trunk/lib/Lex/Lexer.cpp
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Parse/ParseInit.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Parse/ParseTentative.cpp
cfe/trunk/lib/Parse/Parser.cpp
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/lib/Sema/SemaCast.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprMember.cpp
cfe/trunk/lib/Sema/SemaExprObjC.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/lib/Sema/SemaLambda.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp
cfe/trunk/test/Modules/module_file_info.m
cfe/trunk/tools/arcmt-test/arcmt-test.cpp
cfe/trunk/tools/clang-import-test/clang-import-test.cpp
cfe/trunk/tools/libclang/CXType.cpp
Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Tue Oct 30 13:31:30 2018
@@ -294,7 +294,7 @@ def COnly : LangOpt<"CPlusPlus", 1>;
def CPlusPlus : LangOpt<"CPlusPlus">;
def OpenCL : LangOpt<"OpenCL">;
def RenderScript : LangOpt<"RenderScript">;
-def ObjC : LangOpt<"ObjC1">;
+def ObjC : LangOpt<"ObjC">;
def BlocksSupported : LangOpt<"Blocks">;
// Defines targets for target-specific attributes. Empty lists are unchecked.
Modified: cfe/trunk/include/clang/Basic/Features.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Features.def?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Features.def (original)
+++ cfe/trunk/include/clang/Basic/Features.def Tue Oct 30 13:31:30 2018
@@ -88,11 +88,11 @@ FEATURE(objc_arr, LangOpts.ObjCAutoRefCo
FEATURE(objc_arc, LangOpts.ObjCAutoRefCount)
FEATURE(objc_arc_fields, true)
FEATURE(objc_arc_weak, LangOpts.ObjCWeak)
-FEATURE(objc_default_synthesize_properties, LangOpts.ObjC2)
+FEATURE(objc_default_synthesize_properties, LangOpts.ObjC)
FEATURE(objc_fixed_enum, true)
-FEATURE(objc_instancetype, LangOpts.ObjC2)
-FEATURE(objc_kindof, LangOpts.ObjC2)
-FEATURE(objc_modules, LangOpts.ObjC2 &&LangOpts.Modules)
+FEATURE(objc_instancetype, LangOpts.ObjC)
+FEATURE(objc_kindof, LangOpts.ObjC)
+FEATURE(objc_modules, LangOpts.ObjC && LangOpts.Modules)
FEATURE(objc_nonfragile_abi, LangOpts.ObjCRuntime.isNonFragile())
FEATURE(objc_property_explicit_atomic, true)
FEATURE(objc_protocol_qualifier_mangling, true)
@@ -102,16 +102,16 @@ FEATURE(ownership_returns, true)
FEATURE(ownership_takes, true)
FEATURE(objc_bool, true)
FEATURE(objc_subscripting, LangOpts.ObjCRuntime.isNonFragile())
-FEATURE(objc_array_literals, LangOpts.ObjC2)
-FEATURE(objc_dictionary_literals, LangOpts.ObjC2)
-FEATURE(objc_boxed_expressions, LangOpts.ObjC2)
-FEATURE(objc_boxed_nsvalue_expressions, LangOpts.ObjC2)
+FEATURE(objc_array_literals, LangOpts.ObjC)
+FEATURE(objc_dictionary_literals, LangOpts.ObjC)
+FEATURE(objc_boxed_expressions, LangOpts.ObjC)
+FEATURE(objc_boxed_nsvalue_expressions, LangOpts.ObjC)
FEATURE(arc_cf_code_audited, true)
FEATURE(objc_bridge_id, true)
FEATURE(objc_bridge_id_on_typedefs, true)
-FEATURE(objc_generics, LangOpts.ObjC2)
-FEATURE(objc_generics_variance, LangOpts.ObjC2)
-FEATURE(objc_class_property, LangOpts.ObjC2)
+FEATURE(objc_generics, LangOpts.ObjC)
+FEATURE(objc_generics_variance, LangOpts.ObjC)
+FEATURE(objc_class_property, LangOpts.ObjC)
// C11 features
FEATURE(c_alignas, LangOpts.C11)
FEATURE(c_alignof, LangOpts.C11)
Modified: cfe/trunk/include/clang/Basic/LangOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.def (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.def Tue Oct 30 13:31:30 2018
@@ -92,8 +92,7 @@ LANGOPT(CPlusPlus11 , 1, 0, "C++11
LANGOPT(CPlusPlus14 , 1, 0, "C++14")
LANGOPT(CPlusPlus17 , 1, 0, "C++17")
LANGOPT(CPlusPlus2a , 1, 0, "C++2a")
-LANGOPT(ObjC1 , 1, 0, "Objective-C 1")
-LANGOPT(ObjC2 , 1, 0, "Objective-C 2")
+LANGOPT(ObjC , 1, 0, "Objective-C")
BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0,
"Objective-C auto-synthesized properties")
BENIGN_LANGOPT(EncodeExtendedBlockSig , 1, 0,
Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Tue Oct 30 13:31:30 2018
@@ -57,11 +57,8 @@
#ifndef CXX_KEYWORD_OPERATOR
#define CXX_KEYWORD_OPERATOR(X,Y)
#endif
-#ifndef OBJC1_AT_KEYWORD
-#define OBJC1_AT_KEYWORD(X)
-#endif
-#ifndef OBJC2_AT_KEYWORD
-#define OBJC2_AT_KEYWORD(X)
+#ifndef OBJC_AT_KEYWORD
+#define OBJC_AT_KEYWORD(X)
#endif
#ifndef TESTING_KEYWORD
#define TESTING_KEYWORD(X, L) KEYWORD(X, L)
@@ -585,9 +582,9 @@ KEYWORD(__bridge_retained , K
KEYWORD(__bridge_retain , KEYARC)
// Objective-C keywords.
-KEYWORD(__covariant , KEYOBJC2)
-KEYWORD(__contravariant , KEYOBJC2)
-KEYWORD(__kindof , KEYOBJC2)
+KEYWORD(__covariant , KEYOBJC)
+KEYWORD(__contravariant , KEYOBJC)
+KEYWORD(__kindof , KEYOBJC)
// Alternate spelling for various tokens. There are GCC extensions in all
// languages, but should not be disabled in strict conformance mode.
@@ -677,34 +674,34 @@ TESTING_KEYWORD(__unknown_anytype , KEYA
// These have meaning after an '@' in Objective-C mode. These define enums in
// the tok::objc_* namespace.
-OBJC1_AT_KEYWORD(not_keyword)
-OBJC1_AT_KEYWORD(class)
-OBJC1_AT_KEYWORD(compatibility_alias)
-OBJC1_AT_KEYWORD(defs)
-OBJC1_AT_KEYWORD(encode)
-OBJC1_AT_KEYWORD(end)
-OBJC1_AT_KEYWORD(implementation)
-OBJC1_AT_KEYWORD(interface)
-OBJC1_AT_KEYWORD(private)
-OBJC1_AT_KEYWORD(protected)
-OBJC1_AT_KEYWORD(protocol)
-OBJC1_AT_KEYWORD(public)
-OBJC1_AT_KEYWORD(selector)
-OBJC1_AT_KEYWORD(throw)
-OBJC1_AT_KEYWORD(try)
-OBJC1_AT_KEYWORD(catch)
-OBJC1_AT_KEYWORD(finally)
-OBJC1_AT_KEYWORD(synchronized)
-OBJC1_AT_KEYWORD(autoreleasepool)
-
-OBJC2_AT_KEYWORD(property)
-OBJC2_AT_KEYWORD(package)
-OBJC2_AT_KEYWORD(required)
-OBJC2_AT_KEYWORD(optional)
-OBJC2_AT_KEYWORD(synthesize)
-OBJC2_AT_KEYWORD(dynamic)
-OBJC2_AT_KEYWORD(import)
-OBJC2_AT_KEYWORD(available)
+OBJC_AT_KEYWORD(not_keyword)
+OBJC_AT_KEYWORD(class)
+OBJC_AT_KEYWORD(compatibility_alias)
+OBJC_AT_KEYWORD(defs)
+OBJC_AT_KEYWORD(encode)
+OBJC_AT_KEYWORD(end)
+OBJC_AT_KEYWORD(implementation)
+OBJC_AT_KEYWORD(interface)
+OBJC_AT_KEYWORD(private)
+OBJC_AT_KEYWORD(protected)
+OBJC_AT_KEYWORD(protocol)
+OBJC_AT_KEYWORD(public)
+OBJC_AT_KEYWORD(selector)
+OBJC_AT_KEYWORD(throw)
+OBJC_AT_KEYWORD(try)
+OBJC_AT_KEYWORD(catch)
+OBJC_AT_KEYWORD(finally)
+OBJC_AT_KEYWORD(synchronized)
+OBJC_AT_KEYWORD(autoreleasepool)
+
+OBJC_AT_KEYWORD(property)
+OBJC_AT_KEYWORD(package)
+OBJC_AT_KEYWORD(required)
+OBJC_AT_KEYWORD(optional)
+OBJC_AT_KEYWORD(synthesize)
+OBJC_AT_KEYWORD(dynamic)
+OBJC_AT_KEYWORD(import)
+OBJC_AT_KEYWORD(available)
// TODO: What to do about context-sensitive keywords like:
// bycopy/byref/in/inout/oneway/out?
@@ -828,8 +825,7 @@ ANNOTATION(module_end)
#undef ANNOTATION
#undef TESTING_KEYWORD
-#undef OBJC2_AT_KEYWORD
-#undef OBJC1_AT_KEYWORD
+#undef OBJC_AT_KEYWORD
#undef CXX_KEYWORD_OPERATOR
#undef PPKEYWORD
#undef ALIAS
Modified: cfe/trunk/include/clang/Basic/TokenKinds.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.h?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.h (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.h Tue Oct 30 13:31:30 2018
@@ -39,8 +39,7 @@ enum PPKeywordKind {
/// Provides a namespace for Objective-C keywords which start with
/// an '@'.
enum ObjCKeywordKind {
-#define OBJC1_AT_KEYWORD(X) objc_##X,
-#define OBJC2_AT_KEYWORD(X) objc_##X,
+#define OBJC_AT_KEYWORD(X) objc_##X,
#include "clang/Basic/TokenKinds.def"
NUM_OBJC_KEYWORDS
};
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Oct 30 13:31:30 2018
@@ -804,7 +804,7 @@ private:
///
/// Should only be used in Objective-C language modes.
bool isObjCInstancetype() {
- assert(getLangOpts().ObjC1);
+ assert(getLangOpts().ObjC);
if (Tok.isAnnotation())
return false;
if (!Ident_instancetype)
Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Tue Oct 30 13:31:30 2018
@@ -241,7 +241,7 @@ bool arcmt::checkForManualIssues(
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagClient, bool emitPremigrationARCErrors,
StringRef plistOut) {
- if (!origCI.getLangOpts()->ObjC1)
+ if (!origCI.getLangOpts()->ObjC)
return false;
LangOptions::GCMode OrigGCMode = origCI.getLangOpts()->getGC();
@@ -342,7 +342,7 @@ applyTransforms(CompilerInvocation &orig
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagClient, StringRef outputDir,
bool emitPremigrationARCErrors, StringRef plistOut) {
- if (!origCI.getLangOpts()->ObjC1)
+ if (!origCI.getLangOpts()->ObjC)
return false;
LangOptions::GCMode OrigGCMode = origCI.getLangOpts()->getGC();
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Oct 30 13:31:30 2018
@@ -5091,7 +5091,7 @@ bool ASTContext::UnwrapSimilarTypes(Qual
return true;
}
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
const auto *T1OPType = T1->getAs<ObjCObjectPointerType>();
const auto *T2OPType = T2->getAs<ObjCObjectPointerType>();
if (T1OPType && T2OPType) {
@@ -6028,7 +6028,7 @@ bool ASTContext::BlockRequiresCopying(Qu
bool ASTContext::getByrefLifetime(QualType Ty,
Qualifiers::ObjCLifetime &LifeTime,
bool &HasByrefExtendedLayout) const {
- if (!getLangOpts().ObjC1 ||
+ if (!getLangOpts().ObjC ||
getLangOpts().getGC() != LangOptions::NonGC)
return false;
@@ -7706,7 +7706,7 @@ Qualifiers::GC ASTContext::getObjCGCAttr
if (getLangOpts().getGC() == LangOptions::NonGC)
return Qualifiers::GCNone;
- assert(getLangOpts().ObjC1);
+ assert(getLangOpts().ObjC);
Qualifiers::GC GCAttrs = Ty.getObjCGCAttr();
// Default behaviour under objective-C's gc is for ObjC pointers
Modified: cfe/trunk/lib/AST/NSAPI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/NSAPI.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/AST/NSAPI.cpp (original)
+++ cfe/trunk/lib/AST/NSAPI.cpp Tue Oct 30 13:31:30 2018
@@ -509,7 +509,7 @@ bool NSAPI::isObjCNSUIntegerType(QualTyp
}
StringRef NSAPI::GetNSIntegralKind(QualType T) const {
- if (!Ctx.getLangOpts().ObjC1 || T.isNull())
+ if (!Ctx.getLangOpts().ObjC || T.isNull())
return StringRef();
while (const TypedefType *TDT = T->getAs<TypedefType>()) {
@@ -561,7 +561,7 @@ bool NSAPI::isSubclassOfNSClass(ObjCInte
bool NSAPI::isObjCTypedef(QualType T,
StringRef name, IdentifierInfo *&II) const {
- if (!Ctx.getLangOpts().ObjC1)
+ if (!Ctx.getLangOpts().ObjC)
return false;
if (T.isNull())
return false;
@@ -580,7 +580,7 @@ bool NSAPI::isObjCTypedef(QualType T,
bool NSAPI::isObjCEnumerator(const Expr *E,
StringRef name, IdentifierInfo *&II) const {
- if (!Ctx.getLangOpts().ObjC1)
+ if (!Ctx.getLangOpts().ObjC)
return false;
if (!E)
return false;
Modified: cfe/trunk/lib/Analysis/FormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/FormatString.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/FormatString.cpp (original)
+++ cfe/trunk/lib/Analysis/FormatString.cpp Tue Oct 30 13:31:30 2018
@@ -874,7 +874,7 @@ bool FormatSpecifier::hasStandardConvers
return true;
case ConversionSpecifier::CArg:
case ConversionSpecifier::SArg:
- return LangOpt.ObjC1 || LangOpt.ObjC2;
+ return LangOpt.ObjC;
case ConversionSpecifier::InvalidSpecifier:
case ConversionSpecifier::FreeBSDbArg:
case ConversionSpecifier::FreeBSDDArg:
Modified: cfe/trunk/lib/Basic/Builtins.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Builtins.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Builtins.cpp (original)
+++ cfe/trunk/lib/Basic/Builtins.cpp Tue Oct 30 13:31:30 2018
@@ -68,7 +68,7 @@ bool Builtin::Context::builtinIsSupporte
bool GnuModeUnsupported = !LangOpts.GNUMode && (BuiltinInfo.Langs & GNU_LANG);
bool MSModeUnsupported =
!LangOpts.MicrosoftExt && (BuiltinInfo.Langs & MS_LANG);
- bool ObjCUnsupported = !LangOpts.ObjC1 && BuiltinInfo.Langs == OBJC_LANG;
+ bool ObjCUnsupported = !LangOpts.ObjC && BuiltinInfo.Langs == OBJC_LANG;
bool OclC1Unsupported = (LangOpts.OpenCLVersion / 100) != 1 &&
(BuiltinInfo.Langs & ALL_OCLC_LANGUAGES ) == OCLC1X_LANG;
bool OclC2Unsupported = LangOpts.OpenCLVersion != 200 &&
Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/lib/Basic/IdentifierTable.cpp Tue Oct 30 13:31:30 2018
@@ -117,7 +117,7 @@ namespace {
HALFSUPPORT = 0x08000,
CHAR8SUPPORT = 0x10000,
KEYCONCEPTS = 0x20000,
- KEYOBJC2 = 0x40000,
+ KEYOBJC = 0x40000,
KEYZVECTOR = 0x80000,
KEYCOROUTINES = 0x100000,
KEYMODULES = 0x200000,
@@ -163,8 +163,8 @@ static KeywordStatus getKeywordStatus(co
if (LangOpts.C11 && (Flags & KEYC11)) return KS_Enabled;
// We treat bridge casts as objective-C keywords so we can warn on them
// in non-arc mode.
- if (LangOpts.ObjC2 && (Flags & KEYARC)) return KS_Enabled;
- if (LangOpts.ObjC2 && (Flags & KEYOBJC2)) return KS_Enabled;
+ if (LangOpts.ObjC && (Flags & KEYARC)) return KS_Enabled;
+ if (LangOpts.ObjC && (Flags & KEYOBJC)) return KS_Enabled;
if (LangOpts.ConceptsTS && (Flags & KEYCONCEPTS)) return KS_Enabled;
if (LangOpts.CoroutinesTS && (Flags & KEYCOROUTINES)) return KS_Enabled;
if (LangOpts.ModulesTS && (Flags & KEYMODULES)) return KS_Enabled;
@@ -228,11 +228,8 @@ void IdentifierTable::AddKeywords(const
#define CXX_KEYWORD_OPERATOR(NAME, ALIAS) \
if (LangOpts.CXXOperatorNames) \
AddCXXOperatorKeyword(StringRef(#NAME), tok::ALIAS, *this);
-#define OBJC1_AT_KEYWORD(NAME) \
- if (LangOpts.ObjC1) \
- AddObjCKeyword(StringRef(#NAME), tok::objc_##NAME, *this);
-#define OBJC2_AT_KEYWORD(NAME) \
- if (LangOpts.ObjC2) \
+#define OBJC_AT_KEYWORD(NAME) \
+ if (LangOpts.ObjC) \
AddObjCKeyword(StringRef(#NAME), tok::objc_##NAME, *this);
#define TESTING_KEYWORD(NAME, FLAGS)
#include "clang/Basic/TokenKinds.def"
Modified: cfe/trunk/lib/Basic/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Module.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Module.cpp (original)
+++ cfe/trunk/lib/Basic/Module.cpp Tue Oct 30 13:31:30 2018
@@ -119,7 +119,7 @@ static bool hasFeature(StringRef Feature
.Case("c17", LangOpts.C17)
.Case("freestanding", LangOpts.Freestanding)
.Case("gnuinlineasm", LangOpts.GNUAsm)
- .Case("objc", LangOpts.ObjC1)
+ .Case("objc", LangOpts.ObjC)
.Case("objc_arc", LangOpts.ObjCAutoRefCount)
.Case("opencl", LangOpts.OpenCL)
.Case("tls", Target.isTLSSupported())
Modified: cfe/trunk/lib/Basic/Targets/OSTargets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/OSTargets.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/OSTargets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets/OSTargets.cpp Tue Oct 30 13:31:30 2018
@@ -33,7 +33,7 @@ void getDarwinDefines(MacroBuilder &Buil
Builder.defineMacro("_FORTIFY_SOURCE", "0");
// Darwin defines __weak, __strong, and __unsafe_unretained even in C mode.
- if (!Opts.ObjC1) {
+ if (!Opts.ObjC) {
// __weak is always defined, for use in blocks and with objc pointers.
Builder.defineMacro("__weak", "__attribute__((objc_gc(weak)))");
Builder.defineMacro("__strong", "");
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Tue Oct 30 13:31:30 2018
@@ -197,7 +197,7 @@ static llvm::Constant *buildBlockDescrip
std::string descName;
// If an equivalent block descriptor global variable exists, return it.
- if (C.getLangOpts().ObjC1 &&
+ if (C.getLangOpts().ObjC &&
CGM.getLangOpts().getGC() == LangOptions::NonGC) {
descName = getBlockDescriptorName(blockInfo, CGM);
if (llvm::GlobalValue *desc = CGM.getModule().getNamedValue(descName))
@@ -243,7 +243,7 @@ static llvm::Constant *buildBlockDescrip
CGM.GetAddrOfConstantCString(typeAtEncoding).getPointer(), i8p));
// GC layout.
- if (C.getLangOpts().ObjC1) {
+ if (C.getLangOpts().ObjC) {
if (CGM.getLangOpts().getGC() != LangOptions::NonGC)
elements.add(CGM.getObjCRuntime().BuildGCBlockLayout(CGM, blockInfo));
else
@@ -533,7 +533,7 @@ static void computeBlockInfo(CodeGenModu
info.CanBeGlobal = true;
return;
}
- else if (C.getLangOpts().ObjC1 &&
+ else if (C.getLangOpts().ObjC &&
CGM.getLangOpts().getGC() == LangOptions::NonGC)
info.HasCapturedVariableLayout = true;
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Oct 30 13:31:30 2018
@@ -528,11 +528,11 @@ void CGDebugInfo::CreateCompileUnit() {
llvm::dwarf::SourceLanguage LangTag;
const LangOptions &LO = CGM.getLangOpts();
if (LO.CPlusPlus) {
- if (LO.ObjC1)
+ if (LO.ObjC)
LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
else
LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
- } else if (LO.ObjC1) {
+ } else if (LO.ObjC) {
LangTag = llvm::dwarf::DW_LANG_ObjC;
} else if (LO.RenderScript) {
LangTag = llvm::dwarf::DW_LANG_GOOGLE_RenderScript;
@@ -546,7 +546,7 @@ void CGDebugInfo::CreateCompileUnit() {
// Figure out which version of the ObjC runtime we have.
unsigned RuntimeVers = 0;
- if (LO.ObjC1)
+ if (LO.ObjC)
RuntimeVers = LO.ObjCRuntime.isNonFragile() ? 2 : 1;
llvm::DICompileUnit::DebugEmissionKind EmissionKind;
Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Tue Oct 30 13:31:30 2018
@@ -66,7 +66,7 @@ llvm::Constant *CodeGenModule::getTermin
name = "__std_terminate";
else
name = "?terminate@@YAXXZ";
- } else if (getLangOpts().ObjC1 &&
+ } else if (getLangOpts().ObjC &&
getLangOpts().ObjCRuntime.hasTerminate())
name = "objc_terminate";
else
@@ -224,7 +224,7 @@ const EHPersonality &EHPersonality::get(
if (FD && FD->usesSEHTry())
return getSEHPersonalityMSVC(T);
- if (L.ObjC1)
+ if (L.ObjC)
return L.CPlusPlus ? getObjCXXPersonality(Target, L)
: getObjCPersonality(Target, L);
return L.CPlusPlus ? getCXXPersonality(Target, L)
@@ -315,7 +315,7 @@ static bool PersonalityHasOnlyCXXUses(ll
/// when it really needs it.
void CodeGenModule::SimplifyPersonality() {
// If we're not in ObjC++ -fexceptions, there's nothing to do.
- if (!LangOpts.CPlusPlus || !LangOpts.ObjC1 || !LangOpts.Exceptions)
+ if (!LangOpts.CPlusPlus || !LangOpts.ObjC || !LangOpts.Exceptions)
return;
// Both the problem this endeavors to fix and the way the logic
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Oct 30 13:31:30 2018
@@ -2601,7 +2601,7 @@ LValue CodeGenFunction::EmitUnaryOpLValu
// of a pointer to object; as in void foo (__weak id *param); *param = 0;
// But, we continue to generate __strong write barrier on indirect write
// into a pointer to object.
- if (getLangOpts().ObjC1 &&
+ if (getLangOpts().ObjC &&
getLangOpts().getGC() != LangOptions::NonGC &&
LV.isObjCWeak())
LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
@@ -3478,7 +3478,7 @@ LValue CodeGenFunction::EmitArraySubscri
LValue LV = MakeAddrLValue(Addr, E->getType(), EltBaseInfo, EltTBAAInfo);
- if (getLangOpts().ObjC1 &&
+ if (getLangOpts().ObjC &&
getLangOpts().getGC() != LangOptions::NonGC) {
LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
setObjCGCLValueClass(getContext(), E, LV);
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Oct 30 13:31:30 2018
@@ -126,7 +126,7 @@ CodeGenModule::CodeGenModule(ASTContext
RuntimeCC = getTargetCodeGenInfo().getABIInfo().getRuntimeCC();
- if (LangOpts.ObjC1)
+ if (LangOpts.ObjC)
createObjCRuntime();
if (LangOpts.OpenCL)
createOpenCLRuntime();
@@ -149,7 +149,7 @@ CodeGenModule::CodeGenModule(ASTContext
Block.GlobalUniqueCount = 0;
- if (C.getLangOpts().ObjC1)
+ if (C.getLangOpts().ObjC)
ObjCData.reset(new ObjCEntrypoints());
if (CodeGenOpts.hasProfileClangUse()) {
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Tue Oct 30 13:31:30 2018
@@ -2264,8 +2264,7 @@ LangOptions getFormattingLangOpts(const
bool AlternativeOperators = Style.isCpp();
LangOpts.CXXOperatorNames = AlternativeOperators ? 1 : 0;
LangOpts.Bool = 1;
- LangOpts.ObjC1 = 1;
- LangOpts.ObjC2 = 1;
+ LangOpts.ObjC = 1;
LangOpts.MicrosoftExt = 1; // To get kw___try, kw___finally.
LangOpts.DeclSpecKeyword = 1; // To get __declspec.
return LangOpts;
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Tue Oct 30 13:31:30 2018
@@ -2648,9 +2648,9 @@ InputKind ASTUnit::getInputKind() const
else if (LangOpts.RenderScript)
Lang = InputKind::RenderScript;
else if (LangOpts.CPlusPlus)
- Lang = LangOpts.ObjC1 ? InputKind::ObjCXX : InputKind::CXX;
+ Lang = LangOpts.ObjC ? InputKind::ObjCXX : InputKind::CXX;
else
- Lang = LangOpts.ObjC1 ? InputKind::ObjC : InputKind::C;
+ Lang = LangOpts.ObjC ? InputKind::ObjC : InputKind::C;
InputKind::Format Fmt = InputKind::Source;
if (LangOpts.getCompilingModule() == LangOptions::CMK_ModuleMap)
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Tue Oct 30 13:31:30 2018
@@ -1024,7 +1024,7 @@ static InputKind::Language getLanguageFr
return InputKind::OpenCL;
if (LangOpts.CUDA)
return InputKind::CUDA;
- if (LangOpts.ObjC1)
+ if (LangOpts.ObjC)
return LangOpts.CPlusPlus ? InputKind::ObjCXX : InputKind::ObjC;
return LangOpts.CPlusPlus ? InputKind::CXX : InputKind::C;
}
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Oct 30 13:31:30 2018
@@ -1915,7 +1915,7 @@ void CompilerInvocation::setLangDefaults
if (IK.getLanguage() == InputKind::Asm) {
Opts.AsmPreprocessor = 1;
} else if (IK.isObjectiveC()) {
- Opts.ObjC1 = Opts.ObjC2 = 1;
+ Opts.ObjC = 1;
}
if (LangStd == LangStandard::lang_unspecified) {
@@ -2246,7 +2246,7 @@ static void ParseLangArgs(LangOptions &O
Opts.GPURelocatableDeviceCode = Args.hasArg(OPT_fgpu_rdc);
- if (Opts.ObjC1) {
+ if (Opts.ObjC) {
if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
StringRef value = arg->getValue();
if (Opts.ObjCRuntime.tryParse(value))
Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Tue Oct 30 13:31:30 2018
@@ -276,7 +276,7 @@ static void addHeaderInclude(StringRef H
bool IsExternC) {
if (IsExternC && LangOpts.CPlusPlus)
Includes += "extern \"C\" {\n";
- if (LangOpts.ObjC1)
+ if (LangOpts.ObjC)
Includes += "#import \"";
else
Includes += "#include \"";
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Tue Oct 30 13:31:30 2018
@@ -616,11 +616,11 @@ void InitHeaderSearch::Realize(const Lan
for (auto &Include : IncludePath)
if (Include.first == System || Include.first == ExternCSystem ||
- (!Lang.ObjC1 && !Lang.CPlusPlus && Include.first == CSystem) ||
- (/*FIXME !Lang.ObjC1 && */ Lang.CPlusPlus &&
+ (!Lang.ObjC && !Lang.CPlusPlus && Include.first == CSystem) ||
+ (/*FIXME !Lang.ObjC && */ Lang.CPlusPlus &&
Include.first == CXXSystem) ||
- (Lang.ObjC1 && !Lang.CPlusPlus && Include.first == ObjCSystem) ||
- (Lang.ObjC1 && Lang.CPlusPlus && Include.first == ObjCXXSystem))
+ (Lang.ObjC && !Lang.CPlusPlus && Include.first == ObjCSystem) ||
+ (Lang.ObjC && Lang.CPlusPlus && Include.first == ObjCXXSystem))
SearchList.push_back(Include.second);
for (auto &Include : IncludePath)
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Tue Oct 30 13:31:30 2018
@@ -421,7 +421,7 @@ static void InitializeStandardPredefined
Builder.defineMacro("__STDC_UTF_16__", "1");
Builder.defineMacro("__STDC_UTF_32__", "1");
- if (LangOpts.ObjC1)
+ if (LangOpts.ObjC)
Builder.defineMacro("__OBJC__");
// OpenCL v1.0/1.1 s6.9, v1.2/2.0 s6.10: Preprocessor Directives and Macros.
@@ -635,7 +635,7 @@ static void InitializePredefinedMacros(c
if (!LangOpts.MSVCCompat && LangOpts.CPlusPlus11)
Builder.defineMacro("__GXX_EXPERIMENTAL_CXX0X__");
- if (LangOpts.ObjC1) {
+ if (LangOpts.ObjC) {
if (LangOpts.ObjCRuntime.isNonFragile()) {
Builder.defineMacro("__OBJC2__");
@@ -699,7 +699,7 @@ static void InitializePredefinedMacros(c
if (!LangOpts.NoConstantCFStrings)
Builder.defineMacro("__CONSTANT_CFSTRINGS__");
- if (LangOpts.ObjC2)
+ if (LangOpts.ObjC)
Builder.defineMacro("OBJC_NEW_PROPERTIES");
if (LangOpts.PascalStrings)
@@ -1016,7 +1016,7 @@ static void InitializePredefinedMacros(c
Builder.defineMacro("__strong", "__attribute__((objc_gc(strong)))");
Builder.defineMacro("__autoreleasing", "");
Builder.defineMacro("__unsafe_unretained", "");
- } else if (LangOpts.ObjC1) {
+ } else if (LangOpts.ObjC) {
Builder.defineMacro("__weak", "__attribute__((objc_ownership(weak)))");
Builder.defineMacro("__strong", "__attribute__((objc_ownership(strong)))");
Builder.defineMacro("__autoreleasing",
@@ -1130,7 +1130,7 @@ void clang::InitializePreprocessor(
// Install definitions to make Objective-C++ ARC work well with various
// C++ Standard Library implementations.
- if (LangOpts.ObjC1 && LangOpts.CPlusPlus &&
+ if (LangOpts.ObjC && LangOpts.CPlusPlus &&
(LangOpts.ObjCAutoRefCount || LangOpts.ObjCWeak)) {
switch (InitOpts.ObjCXXARCStandardLibrary) {
case ARCXX_nolib:
Modified: cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp Tue Oct 30 13:31:30 2018
@@ -541,7 +541,7 @@ namespace {
// FIXME: This predicate seems like it would be useful to add to ASTContext.
bool isObjCType(QualType T) {
- if (!LangOpts.ObjC1 && !LangOpts.ObjC2)
+ if (!LangOpts.ObjC)
return false;
QualType OCT = Context->getCanonicalType(T).getUnqualifiedType();
Modified: cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp Tue Oct 30 13:31:30 2018
@@ -448,7 +448,7 @@ namespace {
// FIXME: This predicate seems like it would be useful to add to ASTContext.
bool isObjCType(QualType T) {
- if (!LangOpts.ObjC1 && !LangOpts.ObjC2)
+ if (!LangOpts.ObjC)
return false;
QualType OCT = Context->getCanonicalType(T).getUnqualifiedType();
Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Tue Oct 30 13:31:30 2018
@@ -3844,7 +3844,7 @@ LexNextToken:
case '@':
// Objective C support.
- if (CurPtr[-1] == '@' && LangOpts.ObjC1)
+ if (CurPtr[-1] == '@' && LangOpts.ObjC)
Kind = tok::at;
else
Kind = tok::unknown;
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Tue Oct 30 13:31:30 2018
@@ -690,7 +690,7 @@ Preprocessor::getModuleHeaderToIncludeFo
// If we have a module import syntax, we shouldn't include a header to
// make a particular module visible.
- if (getLangOpts().ObjC2)
+ if (getLangOpts().ObjC)
return nullptr;
Module *TopM = M->getTopLevelModule();
@@ -1629,7 +1629,7 @@ static void diagnoseAutoModuleImport(
Preprocessor &PP, SourceLocation HashLoc, Token &IncludeTok,
ArrayRef<std::pair<IdentifierInfo *, SourceLocation>> Path,
SourceLocation PathEnd) {
- assert(PP.getLangOpts().ObjC2 && "no import syntax available");
+ assert(PP.getLangOpts().ObjC && "no import syntax available");
SmallString<128> PathString;
for (size_t I = 0, N = Path.size(); I != N; ++I) {
@@ -1978,7 +1978,7 @@ void Preprocessor::HandleIncludeDirectiv
// Warn that we're replacing the include/import with a module import.
// We only do this in Objective-C, where we have a module-import syntax.
- if (getLangOpts().ObjC2)
+ if (getLangOpts().ObjC)
diagnoseAutoModuleImport(*this, HashLoc, IncludeTok, Path, CharEnd);
// Load the module to import its macros. We'll make the declarations
@@ -2215,7 +2215,7 @@ void Preprocessor::HandleMicrosoftImport
///
void Preprocessor::HandleImportDirective(SourceLocation HashLoc,
Token &ImportTok) {
- if (!LangOpts.ObjC1) { // #import is standard for ObjC.
+ if (!LangOpts.ObjC) { // #import is standard for ObjC.
if (LangOpts.MSVCCompat)
return HandleMicrosoftImportDirective(ImportTok);
Diag(ImportTok, diag::ext_pp_import_directive);
@@ -2686,7 +2686,7 @@ void Preprocessor::HandleDefineDirective
II->isStr("__unsafe_unretained") ||
II->isStr("__autoreleasing");
};
- if (getLangOpts().ObjC1 &&
+ if (getLangOpts().ObjC &&
SourceMgr.getFileID(OtherMI->getDefinitionLoc())
== getPredefinesFileID() &&
isObjCProtectedMacro(MacroNameTok.getIdentifierInfo())) {
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Oct 30 13:31:30 2018
@@ -754,7 +754,7 @@ void Parser::ParseNullabilityTypeSpecifi
case tok::kw__Null_unspecified: {
IdentifierInfo *AttrName = Tok.getIdentifierInfo();
SourceLocation AttrNameLoc = ConsumeToken();
- if (!getLangOpts().ObjC1)
+ if (!getLangOpts().ObjC)
Diag(AttrNameLoc, diag::ext_nullability)
<< AttrName;
attrs.addNew(AttrName, AttrNameLoc, nullptr, AttrNameLoc, nullptr, 0,
@@ -3290,7 +3290,7 @@ void Parser::ParseDeclarationSpecifiers(
// Objective-C supports type arguments and protocol references
// following an Objective-C object or object pointer
// type. Handle either one of them.
- if (Tok.is(tok::less) && getLangOpts().ObjC1) {
+ if (Tok.is(tok::less) && getLangOpts().ObjC) {
SourceLocation NewEndLoc;
TypeResult NewTypeRep = parseObjCTypeArgsAndProtocolQualifiers(
Loc, TypeRep, /*consumeLastToken=*/true,
@@ -3812,7 +3812,7 @@ void Parser::ParseDeclarationSpecifiers(
// GCC ObjC supports types like "<SomeProtocol>" as a synonym for
// "id<SomeProtocol>". This is hopelessly old fashioned and dangerous,
// but we support it.
- if (DS.hasTypeSpecifier() || !getLangOpts().ObjC1)
+ if (DS.hasTypeSpecifier() || !getLangOpts().ObjC)
goto DoneWithDeclSpec;
SourceLocation StartLoc = Tok.getLocation();
@@ -4273,7 +4273,7 @@ void Parser::ParseEnumSpecifier(SourceLo
SourceRange Range;
BaseType = ParseTypeName(&Range);
- if (!getLangOpts().ObjC2) {
+ if (!getLangOpts().ObjC) {
if (getLangOpts().CPlusPlus11)
Diag(StartLoc, diag::warn_cxx98_compat_enum_fixed_underlying_type);
else if (getLangOpts().CPlusPlus)
@@ -4740,7 +4740,7 @@ bool Parser::isTypeSpecifierQualifier()
// GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
case tok::less:
- return getLangOpts().ObjC1;
+ return getLangOpts().ObjC;
case tok::kw___cdecl:
case tok::kw___stdcall:
@@ -4791,7 +4791,7 @@ bool Parser::isDeclarationSpecifier(bool
case tok::identifier: // foo::bar
// Unfortunate hack to support "Class.factoryMethod" notation.
- if (getLangOpts().ObjC1 && NextToken().is(tok::period))
+ if (getLangOpts().ObjC && NextToken().is(tok::period))
return false;
if (TryAltiVecVectorToken())
return true;
@@ -4921,7 +4921,7 @@ bool Parser::isDeclarationSpecifier(bool
// GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
case tok::less:
- return getLangOpts().ObjC1;
+ return getLangOpts().ObjC;
// typedef-name
case tok::annot_typename:
@@ -5762,7 +5762,7 @@ void Parser::ParseDirectDeclarator(Decla
if (D.getContext() == DeclaratorContext::MemberContext) {
// Objective-C++: Detect C++ keywords and try to prevent further errors by
// treating these keyword as valid member names.
- if (getLangOpts().ObjC1 && getLangOpts().CPlusPlus &&
+ if (getLangOpts().ObjC && getLangOpts().CPlusPlus &&
Tok.getIdentifierInfo() &&
Tok.getIdentifierInfo()->isCPlusPlusKeyword(getLangOpts())) {
Diag(getMissingDeclaratorIdLoc(D, Tok.getLocation()),
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Tue Oct 30 13:31:30 2018
@@ -2410,7 +2410,7 @@ Parser::ParseCXXClassMemberDeclaration(A
const ParsedTemplateInfo &TemplateInfo,
ParsingDeclRAIIObject *TemplateDiags) {
if (Tok.is(tok::at)) {
- if (getLangOpts().ObjC1 && NextToken().isObjCAtKeyword(tok::objc_defs))
+ if (getLangOpts().ObjC && NextToken().isObjCAtKeyword(tok::objc_defs))
Diag(Tok, diag::err_at_defs_cxx);
else
Diag(Tok, diag::err_at_in_class);
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Oct 30 13:31:30 2018
@@ -320,7 +320,7 @@ Parser::ParseRHSOfBinaryExpression(ExprR
// as an identifier in ParseObjCMessageExpressionBody. i.e., we support:
// [foo meth:0 and:0];
// [foo not_eq];
- if (getLangOpts().ObjC1 && getLangOpts().CPlusPlus &&
+ if (getLangOpts().ObjC && getLangOpts().CPlusPlus &&
Tok.isOneOf(tok::colon, tok::r_square) &&
OpToken.getIdentifierInfo() != nullptr) {
PP.EnterToken(Tok);
@@ -957,7 +957,7 @@ ExprResult Parser::ParseCastExpression(b
SourceLocation ILoc = ConsumeToken();
// Support 'Class.property' and 'super.property' notation.
- if (getLangOpts().ObjC1 && Tok.is(tok::period) &&
+ if (getLangOpts().ObjC && Tok.is(tok::period) &&
(Actions.getTypeName(II, ILoc, getCurScope()) ||
// Allow the base to be 'super' if in an objc-method.
(&II == Ident_super && getCurScope()->isInObjcMethodScope()))) {
@@ -987,7 +987,7 @@ ExprResult Parser::ParseCastExpression(b
// the token sequence is ill-formed. However, if there's a ':' or ']' after
// that identifier, this is probably a message send with a missing open
// bracket. Treat it as such.
- if (getLangOpts().ObjC1 && &II == Ident_super && !InMessageExpression &&
+ if (getLangOpts().ObjC && &II == Ident_super && !InMessageExpression &&
getCurScope()->isInObjcMethodScope() &&
((Tok.is(tok::identifier) &&
(NextToken().is(tok::colon) || NextToken().is(tok::r_square))) ||
@@ -1002,7 +1002,7 @@ ExprResult Parser::ParseCastExpression(b
// send that's missing the opening '['. Recovery
// appropriately. Also take this path if we're performing code
// completion after an Objective-C class name.
- if (getLangOpts().ObjC1 &&
+ if (getLangOpts().ObjC &&
((Tok.is(tok::identifier) && !InMessageExpression) ||
Tok.is(tok::code_completion))) {
const Token& Next = NextToken();
@@ -1429,7 +1429,7 @@ ExprResult Parser::ParseCastExpression(b
}
case tok::l_square:
if (getLangOpts().CPlusPlus11) {
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
// C++11 lambda expressions and Objective-C message sends both start with a
// square bracket. There are three possibilities here:
// we have a valid lambda expression, we have an invalid lambda
@@ -1443,7 +1443,7 @@ ExprResult Parser::ParseCastExpression(b
Res = ParseLambdaExpression();
break;
}
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
Res = ParseObjCMessageExpression();
break;
}
@@ -1511,7 +1511,7 @@ Parser::ParsePostfixExpressionSuffix(Exp
// If we see identifier: after an expression, and we're not already in a
// message send, then this is probably a message send with a missing
// opening bracket '['.
- if (getLangOpts().ObjC1 && !InMessageExpression &&
+ if (getLangOpts().ObjC && !InMessageExpression &&
(NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
LHS = ParseObjCMessageExpressionBody(SourceLocation(), SourceLocation(),
nullptr, LHS.get());
@@ -1529,7 +1529,7 @@ Parser::ParsePostfixExpressionSuffix(Exp
// actually another message send. In this case, do some look-ahead to see
// if the contents of the square brackets are obviously not a valid
// expression and recover by pretending there is no suffix.
- if (getLangOpts().ObjC1 && Tok.isAtStartOfLine() &&
+ if (getLangOpts().ObjC && Tok.isAtStartOfLine() &&
isSimpleObjCMessageExpression())
return LHS;
@@ -1793,7 +1793,7 @@ Parser::ParsePostfixExpressionSuffix(Exp
// FIXME: Add support for explicit call of template constructor.
SourceLocation TemplateKWLoc;
UnqualifiedId Name;
- if (getLangOpts().ObjC2 && OpKind == tok::period &&
+ if (getLangOpts().ObjC && OpKind == tok::period &&
Tok.is(tok::kw_class)) {
// Objective-C++:
// After a '.' in a member access expression, treat the keyword
@@ -2339,7 +2339,7 @@ Parser::ParseParenExpression(ParenParseO
}
// Diagnose use of bridge casts in non-arc mode.
- bool BridgeCast = (getLangOpts().ObjC2 &&
+ bool BridgeCast = (getLangOpts().ObjC &&
Tok.isOneOf(tok::kw___bridge,
tok::kw___bridge_transfer,
tok::kw___bridge_retained,
@@ -2449,7 +2449,7 @@ Parser::ParseParenExpression(ParenParseO
// this is probably an Objective-C message send where the leading '[' is
// missing. Recover as if that were the case.
if (!DeclaratorInfo.isInvalidType() && Tok.is(tok::identifier) &&
- !InMessageExpression && getLangOpts().ObjC1 &&
+ !InMessageExpression && getLangOpts().ObjC &&
(NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
TypeResult Ty;
{
@@ -2535,7 +2535,7 @@ Parser::ParseParenExpression(ParenParseO
}
// Reject the cast of super idiom in ObjC.
- if (Tok.is(tok::identifier) && getLangOpts().ObjC1 &&
+ if (Tok.is(tok::identifier) && getLangOpts().ObjC &&
Tok.getIdentifierInfo() == Ident_super &&
getCurScope()->isInObjcMethodScope() &&
GetLookAheadToken(1).isNot(tok::period)) {
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Tue Oct 30 13:31:30 2018
@@ -774,7 +774,7 @@ Optional<unsigned> Parser::ParseLambdaIn
// send. In that case, fail here and let the ObjC message
// expression parser perform the completion.
if (Tok.is(tok::code_completion) &&
- !(getLangOpts().ObjC1 && Intro.Default == LCD_None &&
+ !(getLangOpts().ObjC && Intro.Default == LCD_None &&
!Intro.Captures.empty())) {
Actions.CodeCompleteLambdaIntroducer(getCurScope(), Intro,
/*AfterAmpersand=*/false);
@@ -790,7 +790,7 @@ Optional<unsigned> Parser::ParseLambdaIn
if (Tok.is(tok::code_completion)) {
// If we're in Objective-C++ and we have a bare '[', then this is more
// likely to be a message receiver.
- if (getLangOpts().ObjC1 && first)
+ if (getLangOpts().ObjC && first)
Actions.CodeCompleteObjCMessageReceiver(getCurScope());
else
Actions.CodeCompleteLambdaIntroducer(getCurScope(), Intro,
Modified: cfe/trunk/lib/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseInit.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseInit.cpp (original)
+++ cfe/trunk/lib/Parse/ParseInit.cpp Tue Oct 30 13:31:30 2018
@@ -209,7 +209,7 @@ ExprResult Parser::ParseInitializerWithP
// send) or send to 'super', parse this as a message send
// expression. We handle C++ and C separately, since C++ requires
// much more complicated parsing.
- if (getLangOpts().ObjC1 && getLangOpts().CPlusPlus) {
+ if (getLangOpts().ObjC && getLangOpts().CPlusPlus) {
// Send to 'super'.
if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super &&
NextToken().isNot(tok::period) &&
@@ -242,7 +242,7 @@ ExprResult Parser::ParseInitializerWithP
// adopt the expression for further analysis below.
// FIXME: potentially-potentially evaluated expression above?
Idx = ExprResult(static_cast<Expr*>(TypeOrExpr));
- } else if (getLangOpts().ObjC1 && Tok.is(tok::identifier)) {
+ } else if (getLangOpts().ObjC && Tok.is(tok::identifier)) {
IdentifierInfo *II = Tok.getIdentifierInfo();
SourceLocation IILoc = Tok.getLocation();
ParsedType ReceiverType;
@@ -312,7 +312,7 @@ ExprResult Parser::ParseInitializerWithP
// tokens are '...' or ']' or an objc message send. If this is an objc
// message send, handle it now. An objc-message send is the start of
// an assignment-expression production.
- if (getLangOpts().ObjC1 && Tok.isNot(tok::ellipsis) &&
+ if (getLangOpts().ObjC && Tok.isNot(tok::ellipsis) &&
Tok.isNot(tok::r_square)) {
CheckArrayDesignatorSyntax(*this, Tok.getLocation(), Desig);
return ParseAssignmentExprWithObjCMessageExprStart(
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Tue Oct 30 13:31:30 2018
@@ -263,7 +263,7 @@ Decl *Parser::ParseObjCAtInterfaceDeclar
categoryId = Tok.getIdentifierInfo();
categoryLoc = ConsumeToken();
}
- else if (!getLangOpts().ObjC2) {
+ else if (!getLangOpts().ObjC) {
Diag(Tok, diag::err_expected)
<< tok::identifier; // missing category name.
return nullptr;
@@ -705,7 +705,7 @@ void Parser::ParseObjCInterfaceDeclList(
break;
case tok::objc_property:
- if (!getLangOpts().ObjC2)
+ if (!getLangOpts().ObjC)
Diag(AtLoc, diag::err_objc_properties_require_objc2);
ObjCDeclSpec OCDS;
@@ -1103,7 +1103,7 @@ bool Parser::isTokIdentifier_in() const
// FIXME: May have to do additional look-ahead to only allow for
// valid tokens following an 'in'; such as an identifier, unary operators,
// '[' etc.
- return (getLangOpts().ObjC2 && Tok.is(tok::identifier) &&
+ return (getLangOpts().ObjC && Tok.is(tok::identifier) &&
Tok.getIdentifierInfo() == ObjCTypeQuals[objc_in]);
}
@@ -1337,7 +1337,7 @@ Decl *Parser::ParseObjCMethodDecl(Source
// If attributes exist before the method, parse them.
ParsedAttributes methodAttrs(AttrFactory);
- if (getLangOpts().ObjC2)
+ if (getLangOpts().ObjC)
MaybeParseGNUAttributes(methodAttrs);
MaybeParseCXX11Attributes(methodAttrs);
@@ -1364,7 +1364,7 @@ Decl *Parser::ParseObjCMethodDecl(Source
SmallVector<DeclaratorChunk::ParamInfo, 8> CParamInfo;
if (Tok.isNot(tok::colon)) {
// If attributes exist after the method, parse them.
- if (getLangOpts().ObjC2)
+ if (getLangOpts().ObjC)
MaybeParseGNUAttributes(methodAttrs);
MaybeParseCXX11Attributes(methodAttrs);
@@ -1400,7 +1400,7 @@ Decl *Parser::ParseObjCMethodDecl(Source
// If attributes exist before the argument name, parse them.
// Regardless, collect all the attributes we've parsed so far.
- if (getLangOpts().ObjC2)
+ if (getLangOpts().ObjC)
MaybeParseGNUAttributes(paramAttrs);
MaybeParseCXX11Attributes(paramAttrs);
ArgInfo.ArgAttrs = paramAttrs;
@@ -1484,7 +1484,7 @@ Decl *Parser::ParseObjCMethodDecl(Source
// FIXME: Add support for optional parameter list...
// If attributes exist after the method, parse them.
- if (getLangOpts().ObjC2)
+ if (getLangOpts().ObjC)
MaybeParseGNUAttributes(methodAttrs);
MaybeParseCXX11Attributes(methodAttrs);
@@ -1550,7 +1550,7 @@ ParseObjCProtocolReferences(SmallVectorI
TypeResult Parser::parseObjCProtocolQualifierType(SourceLocation &rAngleLoc) {
assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'");
- assert(getLangOpts().ObjC1 && "Protocol qualifiers only exist in Objective-C");
+ assert(getLangOpts().ObjC && "Protocol qualifiers only exist in Objective-C");
SourceLocation lAngleLoc;
SmallVector<Decl *, 8> protocols;
@@ -2945,14 +2945,14 @@ bool Parser::ParseObjCXXMessageReceiver(
/// This routine will only return true for a subset of valid message-send
/// expressions.
bool Parser::isSimpleObjCMessageExpression() {
- assert(Tok.is(tok::l_square) && getLangOpts().ObjC1 &&
+ assert(Tok.is(tok::l_square) && getLangOpts().ObjC &&
"Incorrect start for isSimpleObjCMessageExpression");
return GetLookAheadToken(1).is(tok::identifier) &&
GetLookAheadToken(2).is(tok::identifier);
}
bool Parser::isStartOfObjCClassMessageMissingOpenBracket() {
- if (!getLangOpts().ObjC1 || !NextToken().is(tok::identifier) ||
+ if (!getLangOpts().ObjC || !NextToken().is(tok::identifier) ||
InMessageExpression)
return false;
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Oct 30 13:31:30 2018
@@ -1542,7 +1542,7 @@ StmtResult Parser::ParseForStatement(Sou
}
bool C99orCXXorObjC = getLangOpts().C99 || getLangOpts().CPlusPlus ||
- getLangOpts().ObjC1;
+ getLangOpts().ObjC;
// C99 6.8.5p5 - In C99, the for statement is a block. This is not
// the case for C90. Start the loop scope.
Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Tue Oct 30 13:31:30 2018
@@ -223,7 +223,7 @@ Parser::TPResult Parser::TryConsumeDecla
default:
ConsumeAnyToken();
- if (getLangOpts().ObjC1 && Tok.is(tok::less))
+ if (getLangOpts().ObjC && Tok.is(tok::less))
return TryParseProtocolQualifiers();
break;
}
@@ -649,7 +649,7 @@ Parser::isCXX11AttributeSpecifier(bool D
return CAK_NotAttributeSpecifier;
// No tentative parsing if we don't need to look for ']]' or a lambda.
- if (!Disambiguate && !getLangOpts().ObjC1)
+ if (!Disambiguate && !getLangOpts().ObjC)
return CAK_AttributeSpecifier;
RevertingTentativeParsingAction PA(*this);
@@ -658,7 +658,7 @@ Parser::isCXX11AttributeSpecifier(bool D
ConsumeBracket();
// Outside Obj-C++11, treat anything with a matching ']]' as an attribute.
- if (!getLangOpts().ObjC1) {
+ if (!getLangOpts().ObjC) {
ConsumeBracket();
bool IsAttribute = SkipUntil(tok::r_square);
@@ -1286,7 +1286,7 @@ Parser::isCXXDeclarationSpecifier(Parser
const Token &Next = NextToken();
// In 'foo bar', 'foo' is always a type name outside of Objective-C.
- if (!getLangOpts().ObjC1 && Next.is(tok::identifier))
+ if (!getLangOpts().ObjC && Next.is(tok::identifier))
return TPResult::True;
if (Next.isNot(tok::coloncolon) && Next.isNot(tok::less)) {
@@ -1559,7 +1559,7 @@ Parser::isCXXDeclarationSpecifier(Parser
case tok::annot_typename:
case_typename:
// In Objective-C, we might have a protocol-qualified type.
- if (getLangOpts().ObjC1 && NextToken().is(tok::less)) {
+ if (getLangOpts().ObjC && NextToken().is(tok::less)) {
// Tentatively parse the protocol qualifiers.
RevertingTentativeParsingAction PA(*this);
ConsumeAnyToken(); // The type token
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Tue Oct 30 13:31:30 2018
@@ -443,7 +443,7 @@ void Parser::Initialize() {
// Initialization for Objective-C context sensitive keywords recognition.
// Referenced in Parser::ParseObjCTypeQualifierList.
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
ObjCTypeQuals[objc_in] = &PP.getIdentifierTable().get("in");
ObjCTypeQuals[objc_out] = &PP.getIdentifierTable().get("out");
ObjCTypeQuals[objc_inout] = &PP.getIdentifierTable().get("inout");
@@ -747,7 +747,7 @@ Parser::ParseExternalDeclaration(ParsedA
return ParseObjCAtDirectives(attrs);
case tok::minus:
case tok::plus:
- if (!getLangOpts().ObjC1) {
+ if (!getLangOpts().ObjC) {
Diag(Tok, diag::err_expected_external_declaration);
ConsumeToken();
return nullptr;
@@ -978,7 +978,7 @@ Parser::ParseDeclOrFunctionDefInternal(P
// ObjC2 allows prefix attributes on class interfaces and protocols.
// FIXME: This still needs better diagnostics. We should only accept
// attributes here, no types, etc.
- if (getLangOpts().ObjC2 && Tok.is(tok::at)) {
+ if (getLangOpts().ObjC && Tok.is(tok::at)) {
SourceLocation AtLoc = ConsumeToken(); // the "@"
if (!Tok.isObjCAtKeyword(tok::objc_interface) &&
!Tok.isObjCAtKeyword(tok::objc_protocol)) {
@@ -1554,7 +1554,7 @@ Parser::TryAnnotateName(bool IsAddressOf
/// An Objective-C object type followed by '<' is a specialization of
/// a parameterized class type or a protocol-qualified type.
ParsedType Ty = Classification.getType();
- if (getLangOpts().ObjC1 && NextToken().is(tok::less) &&
+ if (getLangOpts().ObjC && NextToken().is(tok::less) &&
(Ty.get()->isObjCObjectType() ||
Ty.get()->isObjCObjectPointerType())) {
// Consume the name.
@@ -1781,7 +1781,7 @@ bool Parser::TryAnnotateTypeOrScopeToken
/// An Objective-C object type followed by '<' is a specialization of
/// a parameterized class type or a protocol-qualified type.
- if (getLangOpts().ObjC1 && NextToken().is(tok::less) &&
+ if (getLangOpts().ObjC && NextToken().is(tok::less) &&
(Ty.get()->isObjCObjectType() ||
Ty.get()->isObjCObjectPointerType())) {
// Consume the name.
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Tue Oct 30 13:31:30 2018
@@ -152,7 +152,7 @@ Sema::Sema(Preprocessor &pp, ASTContext
for (unsigned I = 0; I != NSAPI::NumNSNumberLiteralMethods; ++I)
NSNumberLiteralMethods[I] = nullptr;
- if (getLangOpts().ObjC1)
+ if (getLangOpts().ObjC)
NSAPIObj.reset(new NSAPI(Context));
if (getLangOpts().CPlusPlus)
@@ -214,7 +214,7 @@ void Sema::Initialize() {
// Initialize predefined Objective-C types:
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
// If 'SEL' does not yet refer to any declarations, make it refer to the
// predefined 'SEL'.
DeclarationName SEL = &Context.Idents.get("SEL");
Modified: cfe/trunk/lib/Sema/SemaCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCast.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCast.cpp Tue Oct 30 13:31:30 2018
@@ -564,7 +564,7 @@ CastsAwayConstness(Sema &Self, QualType
Qualifiers *CastAwayQualifiers = nullptr) {
// If the only checking we care about is for Objective-C lifetime qualifiers,
// and we're not in ObjC mode, there's nothing to check.
- if (!CheckCVR && CheckObjCLifetime && !Self.Context.getLangOpts().ObjC1)
+ if (!CheckCVR && CheckObjCLifetime && !Self.Context.getLangOpts().ObjC)
return CastAwayConstnessKind::CACK_None;
if (!DestType->isReferenceType()) {
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Oct 30 13:31:30 2018
@@ -4165,7 +4165,7 @@ bool Sema::CheckFunctionCall(FunctionDec
CheckAbsoluteValueFunction(TheCall, FDecl);
CheckMaxUnsignedZero(TheCall, FDecl);
- if (getLangOpts().ObjC1)
+ if (getLangOpts().ObjC)
DiagnoseCStringFormatDirectiveInCFAPI(*this, FDecl, Args, NumArgs);
unsigned CMId = FDecl->getMemoryFunctionKind();
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Tue Oct 30 13:31:30 2018
@@ -1090,7 +1090,7 @@ bool ResultBuilder::IsOrdinaryName(const
unsigned IDNS = Decl::IDNS_Ordinary | Decl::IDNS_LocalExtern;
if (SemaRef.getLangOpts().CPlusPlus)
IDNS |= Decl::IDNS_Tag | Decl::IDNS_Namespace | Decl::IDNS_Member;
- else if (SemaRef.getLangOpts().ObjC1) {
+ else if (SemaRef.getLangOpts().ObjC) {
if (isa<ObjCIvarDecl>(ND))
return true;
}
@@ -1115,7 +1115,7 @@ bool ResultBuilder::IsOrdinaryNonTypeNam
unsigned IDNS = Decl::IDNS_Ordinary | Decl::IDNS_LocalExtern;
if (SemaRef.getLangOpts().CPlusPlus)
IDNS |= Decl::IDNS_Tag | Decl::IDNS_Namespace | Decl::IDNS_Member;
- else if (SemaRef.getLangOpts().ObjC1) {
+ else if (SemaRef.getLangOpts().ObjC) {
if (isa<ObjCIvarDecl>(ND))
return true;
}
@@ -1367,7 +1367,7 @@ static void AddTypeSpecifierResults(cons
if (LangOpts.CPlusPlus) {
// C++-specific
Results.AddResult(Result("bool", CCP_Type +
- (LangOpts.ObjC1? CCD_bool_in_ObjC : 0)));
+ (LangOpts.ObjC ? CCD_bool_in_ObjC : 0)));
Results.AddResult(Result("class", CCP_Type));
Results.AddResult(Result("wchar_t", CCP_Type));
@@ -1528,7 +1528,7 @@ static bool WantTypesInContext(Sema::Par
return false;
case Sema::PCC_ForInit:
- return LangOpts.CPlusPlus || LangOpts.ObjC1 || LangOpts.C99;
+ return LangOpts.CPlusPlus || LangOpts.ObjC || LangOpts.C99;
}
llvm_unreachable("Invalid ParserCompletionContext!");
@@ -1741,7 +1741,7 @@ static void AddOrdinaryNameResults(Sema:
}
}
- if (SemaRef.getLangOpts().ObjC1)
+ if (SemaRef.getLangOpts().ObjC)
AddObjCTopLevelResults(Results, true);
AddTypedefResult(Results);
@@ -1857,7 +1857,7 @@ static void AddOrdinaryNameResults(Sema:
Builder.AddChunk(CodeCompletionString::CK_RightBrace);
Results.AddResult(Result(Builder.TakeString()));
}
- if (SemaRef.getLangOpts().ObjC1)
+ if (SemaRef.getLangOpts().ObjC)
AddObjCStatementResults(Results, true);
if (Results.includeCodePatterns()) {
@@ -2185,7 +2185,7 @@ static void AddOrdinaryNameResults(Sema:
}
}
- if (SemaRef.getLangOpts().ObjC1) {
+ if (SemaRef.getLangOpts().ObjC) {
// Add "super", if we're in an Objective-C class with a superclass.
if (ObjCMethodDecl *Method = SemaRef.getCurMethodDecl()) {
// The interface can be NULL.
@@ -2295,7 +2295,7 @@ static void MaybeAddSentinel(Preprocesso
CodeCompletionBuilder &Result) {
if (SentinelAttr *Sentinel = FunctionOrMethod->getAttr<SentinelAttr>())
if (Sentinel->getSentinel() == 0) {
- if (PP.getLangOpts().ObjC1 && PP.isMacroDefined("nil"))
+ if (PP.getLangOpts().ObjC && PP.isMacroDefined("nil"))
Result.AddTextChunk(", nil");
else if (PP.isMacroDefined("NULL"))
Result.AddTextChunk(", NULL");
@@ -3337,7 +3337,7 @@ unsigned clang::getMacroUsagePriority(St
Priority = CCP_Constant;
// Treat "bool" as a type.
else if (MacroName.equals("bool"))
- Priority = CCP_Type + (LangOpts.ObjC1? CCD_bool_in_ObjC : 0);
+ Priority = CCP_Type + (LangOpts.ObjC ? CCD_bool_in_ObjC : 0);
return Priority;
@@ -3501,7 +3501,7 @@ static enum CodeCompletionContext::Kind
case Sema::PCC_ForInit:
if (S.getLangOpts().CPlusPlus || S.getLangOpts().C99 ||
- S.getLangOpts().ObjC1)
+ S.getLangOpts().ObjC)
return CodeCompletionContext::CCC_ParenthesizedExpression;
else
return CodeCompletionContext::CCC_Expression;
@@ -3890,7 +3890,7 @@ void Sema::CodeCompleteExpression(Scope
void Sema::CodeCompletePostfixExpression(Scope *S, ExprResult E) {
if (E.isInvalid())
CodeCompleteOrdinaryName(S, PCC_RecoveryInFunction);
- else if (getLangOpts().ObjC1)
+ else if (getLangOpts().ObjC)
CodeCompleteObjCInstanceMessage(S, E.get(), None, false);
}
@@ -5224,7 +5224,7 @@ static void AddObjCImplementationResults
CodeCompletionBuilder Builder(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
- if (LangOpts.ObjC2) {
+ if (LangOpts.ObjC) {
// @dynamic
Builder.AddTypedTextChunk(OBJC_AT_KEYWORD_NAME(NeedAt,"dynamic"));
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
@@ -5247,7 +5247,7 @@ static void AddObjCInterfaceResults(cons
// Since we have an interface or protocol, we can end it.
Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"end")));
- if (LangOpts.ObjC2) {
+ if (LangOpts.ObjC) {
// @property
Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"property")));
@@ -5443,7 +5443,7 @@ static void AddObjCVisibilityResults(con
Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"private")));
Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"protected")));
Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"public")));
- if (LangOpts.ObjC2)
+ if (LangOpts.ObjC)
Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"package")));
}
@@ -7782,7 +7782,7 @@ void Sema::CodeCompleteObjCMethodDecl(Sc
// Add Key-Value-Coding and Key-Value-Observing accessor methods for all of
// the properties in this class and its categories.
- if (Context.getLangOpts().ObjC2) {
+ if (Context.getLangOpts().ObjC) {
SmallVector<ObjCContainerDecl *, 4> Containers;
Containers.push_back(SearchDecl);
@@ -8011,7 +8011,7 @@ void Sema::CodeCompletePreprocessorDirec
Builder.AddPlaceholderChunk("arguments");
Results.AddResult(Builder.TakeString());
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
// #import "header"
Builder.AddTypedTextChunk("import");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Oct 30 13:31:30 2018
@@ -2111,7 +2111,7 @@ void Sema::MergeTypedefNameDecl(Scope *S
// Allow multiple definitions for ObjC built-in typedefs.
// FIXME: Verify the underlying types are equivalent!
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
const IdentifierInfo *TypeID = New->getIdentifier();
switch (TypeID->getLength()) {
default: break;
@@ -11713,7 +11713,7 @@ void Sema::CheckCompleteVariableDeclarat
// In Objective-C, don't allow jumps past the implicit initialization of a
// local retaining variable.
- if (getLangOpts().ObjC1 &&
+ if (getLangOpts().ObjC &&
var->hasLocalStorage()) {
switch (var->getType().getObjCLifetime()) {
case Qualifiers::OCL_None:
@@ -14593,7 +14593,7 @@ CreateNewDecl:
// If this is an undefined enum, warn.
if (TUK != TUK_Definition && !Invalid) {
TagDecl *Def;
- if (IsFixed && (getLangOpts().CPlusPlus11 || getLangOpts().ObjC2) &&
+ if (IsFixed && (getLangOpts().CPlusPlus11 || getLangOpts().ObjC) &&
cast<EnumDecl>(New)->isFixed()) {
// C++0x: 7.2p2: opaque-enum-declaration.
// Conflicts are diagnosed above. Do nothing.
@@ -15772,7 +15772,7 @@ void Sema::ActOnFields(Scope *S, SourceL
}
ObjCFieldLifetimeErrReported = true;
}
- } else if (getLangOpts().ObjC1 &&
+ } else if (getLangOpts().ObjC &&
getLangOpts().getGC() != LangOptions::NonGC &&
Record && !Record->hasObjectMember()) {
if (FD->getType()->isObjCObjectPointerType() ||
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Tue Oct 30 13:31:30 2018
@@ -7733,7 +7733,7 @@ public:
bool VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *E) {
SemaRef.Diag(E->getBeginLoc(), diag::warn_at_available_unchecked_use)
- << (!SemaRef.getLangOpts().ObjC1);
+ << (!SemaRef.getLangOpts().ObjC);
return true;
}
@@ -7788,8 +7788,8 @@ void DiagnoseUnguardedAvailability::Diag
auto FixitDiag =
SemaRef.Diag(Range.getBegin(), diag::note_unguarded_available_silence)
<< Range << D
- << (SemaRef.getLangOpts().ObjC1 ? /*@available*/ 0
- : /*__builtin_available*/ 1);
+ << (SemaRef.getLangOpts().ObjC ? /*@available*/ 0
+ : /*__builtin_available*/ 1);
// Find the statement which should be enclosed in the if @available check.
if (StmtStack.empty())
@@ -7833,8 +7833,8 @@ void DiagnoseUnguardedAvailability::Diag
const char *ExtraIndentation = " ";
std::string FixItString;
llvm::raw_string_ostream FixItOS(FixItString);
- FixItOS << "if (" << (SemaRef.getLangOpts().ObjC1 ? "@available"
- : "__builtin_available")
+ FixItOS << "if (" << (SemaRef.getLangOpts().ObjC ? "@available"
+ : "__builtin_available")
<< "("
<< AvailabilityAttr::getPlatformNameSourceSpelling(
SemaRef.getASTContext().getTargetInfo().getPlatformName())
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Oct 30 13:31:30 2018
@@ -13688,7 +13688,7 @@ VarDecl *Sema::BuildExceptionDeclaration
// Only the non-fragile NeXT runtime currently supports C++ catches
// of ObjC types, and no runtime supports catching ObjC types by value.
- if (!Invalid && getLangOpts().ObjC1) {
+ if (!Invalid && getLangOpts().ObjC) {
QualType T = ExDeclType;
if (const ReferenceType *RT = T->getAs<ReferenceType>())
T = RT->getPointeeType();
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Oct 30 13:31:30 2018
@@ -7886,7 +7886,7 @@ Sema::CheckAssignmentConstraints(QualTyp
}
// id -> T^
- if (getLangOpts().ObjC1 && RHSType->isObjCIdType()) {
+ if (getLangOpts().ObjC && RHSType->isObjCIdType()) {
Kind = CK_AnyPointerToBlockPointerCast;
return Compatible;
}
@@ -8195,7 +8195,7 @@ Sema::CheckSingleAssignmentConstraints(Q
if (!Diagnose)
return Incompatible;
}
- if (getLangOpts().ObjC1 &&
+ if (getLangOpts().ObjC &&
(CheckObjCBridgeRelatedConversions(E->getBeginLoc(), LHSType,
E->getType(), E, Diagnose) ||
ConversionToObjCStringLiteralCheck(LHSType, E, Diagnose))) {
@@ -11947,7 +11947,7 @@ static void DiagnoseSelfAssignment(Sema
/// is usually indicative of introspection within the Objective-C pointer.
static void checkObjCPointerIntrospection(Sema &S, ExprResult &L, ExprResult &R,
SourceLocation OpLoc) {
- if (!S.getLangOpts().ObjC1)
+ if (!S.getLangOpts().ObjC)
return;
const Expr *ObjCPointerExpr = nullptr, *OtherExpr = nullptr;
@@ -13738,7 +13738,7 @@ ExprResult Sema::ActOnGNUNullExpr(Source
bool Sema::ConversionToObjCStringLiteralCheck(QualType DstType, Expr *&Exp,
bool Diagnose) {
- if (!getLangOpts().ObjC1)
+ if (!getLangOpts().ObjC)
return false;
const ObjCObjectPointerType *PT = DstType->getAs<ObjCObjectPointerType>();
Modified: cfe/trunk/lib/Sema/SemaExprMember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprMember.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprMember.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprMember.cpp Tue Oct 30 13:31:30 2018
@@ -496,7 +496,7 @@ Sema::ActOnDependentMemberExpr(Expr *Bas
// allows this, while still reporting an error if T is a struct pointer.
if (!IsArrow) {
const PointerType *PT = BaseType->getAs<PointerType>();
- if (PT && (!getLangOpts().ObjC1 ||
+ if (PT && (!getLangOpts().ObjC ||
PT->getPointeeType()->isRecordType())) {
assert(BaseExpr && "cannot happen with implicit member accesses");
Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Tue Oct 30 13:31:30 2018
@@ -3892,7 +3892,7 @@ static bool CheckObjCBridgeCFCast(Sema &
}
void Sema::CheckTollFreeBridgeCast(QualType castType, Expr *castExpr) {
- if (!getLangOpts().ObjC1)
+ if (!getLangOpts().ObjC)
return;
// warn in presence of __bridge casting to or from a toll free bridge cast.
ARCConversionTypeClass exprACTC = classifyTypeForARCConversion(castExpr->getType());
@@ -3964,7 +3964,7 @@ void Sema::CheckObjCBridgeRelatedCast(Qu
bool Sema::CheckTollFreeBridgeStaticCast(QualType castType, Expr *castExpr,
CastKind &Kind) {
- if (!getLangOpts().ObjC1)
+ if (!getLangOpts().ObjC)
return false;
ARCConversionTypeClass exprACTC =
classifyTypeForARCConversion(castExpr->getType());
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Tue Oct 30 13:31:30 2018
@@ -5381,7 +5381,7 @@ void InitializationSequence::InitializeF
Expr *Initializer = nullptr;
if (Args.size() == 1) {
Initializer = Args[0];
- if (S.getLangOpts().ObjC1) {
+ if (S.getLangOpts().ObjC) {
if (S.CheckObjCBridgeRelatedConversions(Initializer->getBeginLoc(),
DestType, Initializer->getType(),
Initializer) ||
Modified: cfe/trunk/lib/Sema/SemaLambda.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLambda.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLambda.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLambda.cpp Tue Oct 30 13:31:30 2018
@@ -1636,7 +1636,7 @@ ExprResult Sema::BuildLambdaExpr(SourceL
// same parameter and return types as the closure type's function call
// operator.
// FIXME: Fix generic lambda to block conversions.
- if (getLangOpts().Blocks && getLangOpts().ObjC1 && !IsGenericLambda)
+ if (getLangOpts().Blocks && getLangOpts().ObjC && !IsGenericLambda)
addBlockPointerConversion(*this, IntroducerRange, Class, CallOperator);
// Finalize the lambda class.
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue Oct 30 13:31:30 2018
@@ -1418,7 +1418,7 @@ Sema::PerformImplicitConversion(Expr *Fr
bool AllowObjCWritebackConversion
= getLangOpts().ObjCAutoRefCount &&
(Action == AA_Passing || Action == AA_Sending);
- if (getLangOpts().ObjC1)
+ if (getLangOpts().ObjC)
CheckObjCBridgeRelatedConversions(From->getBeginLoc(), ToType,
From->getType(), From);
ICS = ::TryImplicitConversion(*this, From, ToType,
@@ -2395,7 +2395,7 @@ static QualType AdoptQualifiers(ASTConte
bool Sema::isObjCPointerConversion(QualType FromType, QualType ToType,
QualType& ConvertedType,
bool &IncompatibleObjC) {
- if (!getLangOpts().ObjC1)
+ if (!getLangOpts().ObjC)
return false;
// The set of qualifiers on the type we're converting from.
@@ -3516,7 +3516,7 @@ Sema::DiagnoseMultipleUserDefinedConvers
static ImplicitConversionSequence::CompareKind
compareConversionFunctions(Sema &S, FunctionDecl *Function1,
FunctionDecl *Function2) {
- if (!S.getLangOpts().ObjC1 || !S.getLangOpts().CPlusPlus11)
+ if (!S.getLangOpts().ObjC || !S.getLangOpts().CPlusPlus11)
return ImplicitConversionSequence::Indistinguishable;
// Objective-C++:
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Tue Oct 30 13:31:30 2018
@@ -4324,7 +4324,7 @@ static TypeSourceInfo *GetFullTypeForDec
inferPointerNullability(SimplePointerKind::Pointer, DeclType.Loc,
DeclType.EndLoc, DeclType.getAttrs());
- if (LangOpts.ObjC1 && T->getAs<ObjCObjectType>()) {
+ if (LangOpts.ObjC && T->getAs<ObjCObjectType>()) {
T = Context.getObjCObjectPointerType(T);
if (DeclType.Ptr.TypeQuals)
T = S.BuildQualifiedType(T, DeclType.Loc, DeclType.Ptr.TypeQuals);
@@ -5238,7 +5238,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarat
TypeSourceInfo *ReturnTypeInfo = nullptr;
QualType declSpecTy = GetDeclSpecTypeForDeclarator(state, ReturnTypeInfo);
- if (getLangOpts().ObjC1) {
+ if (getLangOpts().ObjC) {
Qualifiers::ObjCLifetime ownership = Context.getInnerObjCOwnership(FromTy);
if (ownership != Qualifiers::OCL_None)
transferARCOwnership(state, declSpecTy, ownership);
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp Tue Oct 30 13:31:30 2018
@@ -89,6 +89,6 @@ void ObjCAtSyncChecker::checkPreStmt(con
}
void ento::registerObjCAtSyncChecker(CheckerManager &mgr) {
- if (mgr.getLangOpts().ObjC2)
+ if (mgr.getLangOpts().ObjC)
mgr.registerChecker<ObjCAtSyncChecker>();
}
Modified: cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp (original)
+++ cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp Tue Oct 30 13:31:30 2018
@@ -24,8 +24,7 @@ LangOptions createLangOpts() {
LangOpts.LineComment = 1;
LangOpts.CXXOperatorNames = 1;
LangOpts.Bool = 1;
- LangOpts.ObjC1 = 1;
- LangOpts.ObjC2 = 1;
+ LangOpts.ObjC = 1;
LangOpts.MicrosoftExt = 1; // To get kw___try, kw___finally.
LangOpts.DeclSpecKeyword = 1; // To get __declspec.
LangOpts.WChar = 1; // To get wchar_t
Modified: cfe/trunk/test/Modules/module_file_info.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/module_file_info.m?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/test/Modules/module_file_info.m (original)
+++ cfe/trunk/test/Modules/module_file_info.m Tue Oct 30 13:31:30 2018
@@ -20,7 +20,7 @@
// CHECK: Language options:
// CHECK: C99: Yes
-// CHECK: Objective-C 1: Yes
+// CHECK: Objective-C: Yes
// CHECK: modules extension to C: Yes
// CHECK: Module features:
// CHECK: myfeature
Modified: cfe/trunk/tools/arcmt-test/arcmt-test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/arcmt-test/arcmt-test.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/tools/arcmt-test/arcmt-test.cpp (original)
+++ cfe/trunk/tools/arcmt-test/arcmt-test.cpp Tue Oct 30 13:31:30 2018
@@ -130,7 +130,7 @@ static bool checkForMigration(StringRef
return true;
}
- if (!CI.getLangOpts()->ObjC1)
+ if (!CI.getLangOpts()->ObjC)
return false;
arcmt::checkForManualIssues(CI, CI.getFrontendOpts().Inputs[0],
@@ -170,7 +170,7 @@ static bool performTransformations(Strin
return true;
}
- if (!origCI.getLangOpts()->ObjC1)
+ if (!origCI.getLangOpts()->ObjC)
return false;
MigrationProcess migration(origCI, std::make_shared<PCHContainerOperations>(),
Modified: cfe/trunk/tools/clang-import-test/clang-import-test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-import-test/clang-import-test.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/tools/clang-import-test/clang-import-test.cpp (original)
+++ cfe/trunk/tools/clang-import-test/clang-import-test.cpp Tue Oct 30 13:31:30 2018
@@ -182,8 +182,7 @@ std::unique_ptr<CompilerInstance> BuildC
Inv->getHeaderSearchOpts().UseLibcxx = true;
}
if (isObjC(Id)) {
- Inv->getLangOpts()->ObjC1 = 1;
- Inv->getLangOpts()->ObjC2 = 1;
+ Inv->getLangOpts()->ObjC = 1;
}
}
Inv->getLangOpts()->Bool = true;
Modified: cfe/trunk/tools/libclang/CXType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXType.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXType.cpp (original)
+++ cfe/trunk/tools/libclang/CXType.cpp Tue Oct 30 13:31:30 2018
@@ -136,7 +136,7 @@ CXType cxtype::MakeCXType(QualType T, CX
}
ASTContext &Ctx = cxtu::getASTUnit(TU)->getASTContext();
- if (Ctx.getLangOpts().ObjC1) {
+ if (Ctx.getLangOpts().ObjC) {
QualType UnqualT = T.getUnqualifiedType();
if (Ctx.isObjCIdType(UnqualT))
TK = CXType_ObjCId;
More information about the cfe-commits
mailing list