TargetParser: fix getProcessTriple in universal builds
authorJon Roelofs <jonathan_roelofs@apple.com>
Fri, 14 Jul 2023 20:23:00 +0000 (13:23 -0700)
committerJon Roelofs <jonathan_roelofs@apple.com>
Fri, 14 Jul 2023 20:44:43 +0000 (13:44 -0700)
commitdc078e6eaacff66596fac76b6104aa504f77d45d
tree4f1f8c31d1e89ca7ce08abb8bb10a59d50892a44
parentb9543f7de69770a97e983452c5158acc3b4783c7
TargetParser: fix getProcessTriple in universal builds

The bug happens when you build e.g. an x64_64;arm64 JIT with
LLVM_HOST_TRIPLE=x86_64-apple-macos, and then run it on an apple-m1 not under
Rosetta. In that case, sys::getProcessTriple() will return an x86_64 triple,
not an arm64 one.

Differential revision: https://reviews.llvm.org/D138449
llvm/lib/TargetParser/Host.cpp