Skip to content

Commit 675cffc

Browse files
committedMar 3, 2015
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
1 parent 23f94df commit 675cffc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎llvm/lib/Support/Triple.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,14 @@ void Triple::getOSVersion(unsigned &Major, unsigned &Minor,
714714
unsigned &Micro) const {
715715
StringRef OSName = getOSName();
716716

717+
// For Android, we care about the Android version rather than the Linux
718+
// version.
719+
if (getEnvironment() == Android) {
720+
OSName = getEnvironmentName().substr(strlen("android"));
721+
if (OSName.startswith("eabi"))
722+
OSName = OSName.substr(strlen("eabi"));
723+
}
724+
717725
// Assume that the OS portion of the triple starts with the canonical name.
718726
StringRef OSTypeName = getOSTypeName(getOS());
719727
if (OSName.startswith(OSTypeName))

0 commit comments

Comments
 (0)
Please sign in to comment.