[PATCH] D34446: [Support] sys::getProcessTriple should return a macOS triple using the system's version of macOS

Alex Lorenz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 06:43:47 PDT 2017


arphaman added a comment.

In https://reviews.llvm.org/D34446#787263, @dexonsmith wrote:

> > Right now, `sys::getProcessTriple` returns the `LLVM_HOST_TRIPLE`, whose system version might not be the actual version of the system on which the compiler running.
>
> Are we sure no one depends on that behaviour?


The primary users of this function are the JIT libraries, but so far I haven't found any checks for the OS version in the JIT code. And it looks like most of the other users of this function don't check the OS version.

> 
> 
>> I'm not sure if it's possible to test this change (Please let me know if I'm wrong though).
> 
> I think we could add a lit test with `REQUIRES: shell` that only runs on macOS and uses `sw_vers` to pull out the system OS version.  If any builder has a non-matching `LLVM_HOST_TRIPLE`, we have some test coverage.

I've added a unittest that uses `sw_vers`.


Repository:
  rL LLVM

https://reviews.llvm.org/D34446





More information about the llvm-commits mailing list