This is an archive of the discontinued LLVM Phabricator instance.

[LLVM][Support] Add macOS 12 to Triple.cpp
AbandonedPublic

Authored by gAlfonso-bit on Aug 12 2021, 8:56 AM.

Details

Reviewers
MaskRay
arphaman
Group Reviewers
Restricted Project
Summary

Since macOS 12 Monterey is around the corner, it might be good to prepare.

Also, since we are here, remove llvm-unreachable that is already taken care of by the default statements as well as comment typos.

Diff Detail

Event Timeline

gAlfonso-bit created this revision.Aug 12 2021, 8:56 AM
gAlfonso-bit requested review of this revision.Aug 12 2021, 8:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2021, 8:56 AM
jrtc27 added a subscriber: jrtc27.Aug 24 2021, 1:56 PM
jrtc27 added inline comments.
llvm/lib/Support/Triple.cpp
1143

You're not touching these functions, leave them alone

1767

Don't include unrelated changes

1775

This function isn't used by LLVM, it's only used by Swift, and I don't know if they need to support 10.17 meaning 12 or whether 10.16 meaning 11 was just a one-off due to having a bunch of code already written that was using 10.16 in @available etc annotations. IMO this should be left alone until someone from Apple decides they do in fact need this; their fork of LLVM doesn't currently have this function changed, for example, though that could just be because they haven't made Monterey changes public yet (but if it's needed they'll have already discovered that long ago).

dexonsmith added a subscriber: arphaman.

I believe this code change isn't needed, but @arphaman can confirm. Adding him as a blocking reviewer since he's been upstreaming other related code.

@gAlfonso-bit, FYI, if you're eager to help out, many of Apple's downstream changes have been officially contributed to the LLVM project at https://github.com/llvm/llvm-project-staging (see, e.g., the staging/apple branch), but are waiting to be separated, likely cleaned up a bit, and then reviewed (here, at http://reviews.llvm.org). Reach out to me over email if you're interested in tackling something. I can help choose what to break off and/or help find a reviewer.

llvm/lib/Support/Triple.cpp
1143

BTW, I'd be happy to review a standalone, NFC patch that fixes these comments (IOS vs iOS). (I agree with @jrtc27 that it's better not to include unrelated changes in this patch.)

1637

I think the comment is referring to the vendor part of the triple, which is apple, so lowercase is better. Maybe could be in quotes though, something like "If vendor is 'apple'", but I'm not sure this is worth changing.

1683

The + seems redundant, since "starting from" should cover it.

1767

Why remove this?

1775

FWIW, this function is also used by clang downstream (e.g., see https://github.com/apple/llvm-project/blob/next/clang/lib/Sema/SemaDeclAttr.cpp#L2473).

jrtc27 added inline comments.Aug 24 2021, 3:24 PM
llvm/lib/Support/Triple.cpp
1767

I assume because a sufficiently-smart compiler can notice it's dead code since the above switch is exhaustive and always returns. But a sufficiently-dumb compiler wouldn't notice that and need something to avoid a warning about the opposite...

1775

Ah, didn't think to look at your Clang, but in hindsight should probably have realised that the (Obj)C(++) equivalent attributes would likely have the same issue...

gAlfonso-bit abandoned this revision.Sep 21 2021, 11:53 AM