forked from OSchip/llvm-project
Make Triple::getOSVersion make sense for Android.
Reviewers: srhines Reviewed By: srhines Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7928 llvm-svn: 231090
This commit is contained in:
parent
23f94dfdf4
commit
675cffcb91
|
@ -714,6 +714,14 @@ void Triple::getOSVersion(unsigned &Major, unsigned &Minor,
|
|||
unsigned &Micro) const {
|
||||
StringRef OSName = getOSName();
|
||||
|
||||
// For Android, we care about the Android version rather than the Linux
|
||||
// version.
|
||||
if (getEnvironment() == Android) {
|
||||
OSName = getEnvironmentName().substr(strlen("android"));
|
||||
if (OSName.startswith("eabi"))
|
||||
OSName = OSName.substr(strlen("eabi"));
|
||||
}
|
||||
|
||||
// Assume that the OS portion of the triple starts with the canonical name.
|
||||
StringRef OSTypeName = getOSTypeName(getOS());
|
||||
if (OSName.startswith(OSTypeName))
|
||||
|
|
Loading…
Reference in New Issue