erik.pilkington accepted this revision.
erik.pilkington added a comment.
This revision is now accepted and ready to land.

LGTM, after mine and Aaron's comments.



================
Comment at: clang/lib/Sema/SemaExpr.cpp:19195-19211
+    if (Spec == AvailSpecs.end())
+      return None;
+    if (Platform == "macos") {
+      return ObjCAvailabilityCheckExpr::VersionAsWritten{
+          llvm::Triple::getCanonicalVersionForOS(llvm::Triple::MacOSX,
+                                                 Spec->getVersion()),
+          Spec->getVersion()};
----------------
nit: The lambda returning an optional seems a little overkill here, e.g. seems 
this could just be:

```
    ObjCAvailabilityCheckExpr::VersionAsWritten Version;
    if (Spec != AvailSpecs.end()) {
      if (Platform == "macos") {
        Version = ObjCAvailabilityCheckExpr::VersionAsWritten{
            llvm::Triple::getCanonicalVersionForOS(llvm::Triple::MacOSX,
                                                   Spec->getVersion()),
            Spec->getVersion()};
      } else {
        Version = 
ObjCAvailabilityCheckExpr::VersionAsWritten{Spec->getVersion(),
                                                       Spec->getVersion()};
      }
    }
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82823/new/

https://reviews.llvm.org/D82823



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to