[PATCH] D53547: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 30 13:55:09 PDT 2018


erik.pilkington added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp:23
   // this check should only be applied to ObjC sources.
-  if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) {
+  if (!getLangOpts().ObjC) {
     return;
----------------
theraven wrote:
> LLVM style wants to get rid of the braces here (and the next few instances of this).  Since you're touching this code, would you mind fixing that as well?
Sure, I did this in the commit. Thanks for reviewing!


================
Comment at: clang/lib/Basic/IdentifierTable.cpp:166-167
   // 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;
----------------
erik.pilkington wrote:
> rsmith wrote:
> > Would it make sense to fold `KEYOBJC` and `KEYARC` together?
> Yep, good point. Looks like we used to only enable these keywords in -fobjc-arc mode, but now that we're doing it for objective-c there isn't any distinction to be made here. I'll commit this in a follow-up.
Done in r345646.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53547





More information about the cfe-commits mailing list