[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 15:57:32 PDT 2017


erik.pilkington added inline comments.


================
Comment at: lib/Sema/SemaDeclAttr.cpp:6944
-    diag = !ObjCPropertyAccess ? diag::err_unavailable
-                               : diag::err_property_method_unavailable;
-    diag_message = diag::err_unavailable_message;
----------------
Why did you remove the AR_Unavailable checking?


================
Comment at: lib/Sema/SemaDeclAttr.cpp:7021
+    bool NewWarning =
+        !S.Diags.isIgnored(diag::warn_unguarded_availability_new, Loc) &&
+        shouldDiagnoseAvailabilityByDefault(
----------------
I think checking Diags::isIgnored is fairly expensive, maybe we should swap the operands to the '&&' so that it is only done if necessary?


Repository:
  rL LLVM

https://reviews.llvm.org/D34264





More information about the cfe-commits mailing list