This is the first of many Pointer Authentication-related patches we're happy to finally upstream =]
For a high-level overview, see our llvm-dev RFC: http://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html, as well as the devmtg talk we did at the same time last year.
For concrete code that builds on this, see the staging PR in apple/llvm-project: https://github.com/apple/llvm-project/pull/14. Though we've made changes downstream since then, the general concepts and added constructs are mostly identical.
Per commit message:
This also teaches MachO writers/readers about the MachO cpu subtype, beyond the minimal subtype reader support present at the moment. This also defines a preprocessor macro to allow users to distinguish __arm64__ from __arm64e__. arm64e defaults to an "apple-a12" CPU, which supports v8.3a, allowing pointer-authentication codegen. It also currently defaults to ios14+ and macos11+.
If it helps, we can obviously split this patch further, but I feel like this all belongs together, as the core boilerplate needed for new (darwin) targets.
Note that this adds a Triple::isArm64e(), which is a bit of a departure from prior subarches, in part because we check it more often. The obvious alternative would be to compare Triple::getArchName() with "arm64e"; I'm fine with either. However, I would like to preserve the "arm64e" naming, as we refer to that extensively in Darwin-land.
Nit: it's probably worth fixing these two Linter issues, since this function is small anyway.