[llvm] r231090 - Make Triple::getOSVersion make sense for Android.

Eric Christopher echristo at gmail.com
Tue Mar 3 10:50:30 PST 2015


Add something to the unittest?

-eric

On Tue, Mar 3, 2015 at 10:31 AM Dan Albert <danalbert at google.com> wrote:

> Author: danalbert
> Date: Tue Mar  3 12:23:51 2015
> New Revision: 231090
>
> URL: http://llvm.org/viewvc/llvm-project?rev=231090&view=rev
> Log:
> Make Triple::getOSVersion make sense for Android.
>
> Reviewers: srhines
>
> Reviewed By: srhines
>
> Subscribers: llvm-commits
>
> Differential Revision: http://reviews.llvm.org/D7928
>
> Modified:
>     llvm/trunk/lib/Support/Triple.cpp
>
> Modified: llvm/trunk/lib/Support/Triple.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Support/Triple.cpp?rev=231090&r1=231089&r2=231090&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/Support/Triple.cpp (original)
> +++ llvm/trunk/lib/Support/Triple.cpp Tue Mar  3 12:23:51 2015
> @@ -714,6 +714,14 @@ void Triple::getOSVersion(unsigned &Majo
>                            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))
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150303/b0854175/attachment.html>


More information about the llvm-commits mailing list