[PATCH] D34446: [Support] sys::getProcessTriple should return a macOS triple using the system's version of macOS
Lang Hames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 14:20:38 PDT 2017
lhames accepted this revision.
lhames added a comment.
This revision is now accepted and ready to land.
Sorry for the delayed reply.
LGTM (though see inline comment).
The getProcessTriple function is pretty fundamentally broken as it stands: it doesn't do the right thing when you're cross compiling (e.g. an ARM compiler built on x86 will claim that the process triple is x86_64-...). One day we should tackle that. This seems like a strict improvement in the mean time though.
- Lang.
================
Comment at: lib/Support/Unix/Host.inc:37-53
+static void updateTripleOSVersion(std::string &TargetTripleString) {
+ // On darwin, we want to update the version to match that of the target.
std::string::size_type DarwinDashIdx = TargetTripleString.find("-darwin");
if (DarwinDashIdx != std::string::npos) {
TargetTripleString.resize(DarwinDashIdx + strlen("-darwin"));
TargetTripleString += getOSVersion();
+ return;
----------------
Minor nitpick: This seems like it would be nicer as a function from a string to a string, rather than a mutating operation.
Repository:
rL LLVM
https://reviews.llvm.org/D34446
More information about the llvm-commits
mailing list