[llvm-commits] [llvm] r156483 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp
Chad Rosier
mcrosier at apple.com
Wed May 9 10:37:48 PDT 2012
On May 9, 2012, at 10:35 AM, Eli Friedman wrote:
> On Wed, May 9, 2012 at 10:23 AM, Chad Rosier <mcrosier at apple.com> wrote:
>> Author: mcrosier
>> Date: Wed May 9 12:23:48 2012
>> New Revision: 156483
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=156483&view=rev
>> Log:
>> Add Triple::getiOSVersion.
>>
>> This new function provides a way to get the iOS version number from ios triples.
>> Part of rdar://11409204
>>
>> Modified:
>> llvm/trunk/include/llvm/ADT/Triple.h
>> llvm/trunk/lib/Support/Triple.cpp
>>
>> Modified: llvm/trunk/include/llvm/ADT/Triple.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=156483&r1=156482&r2=156483&view=diff
>> ==============================================================================
>> --- llvm/trunk/include/llvm/ADT/Triple.h (original)
>> +++ llvm/trunk/include/llvm/ADT/Triple.h Wed May 9 12:23:48 2012
>> @@ -196,6 +196,11 @@
>> bool getMacOSXVersion(unsigned &Major, unsigned &Minor,
>> unsigned &Micro) const;
>>
>> + /// getiOSVersion - Parse the version number as with getOSVersion. This should
>> + /// only be called with IOS triples.
>> + void getiOSVersion(unsigned &Major, unsigned &Minor,
>> + unsigned &Micro) const;
>> +
>> /// @}
>> /// @name Direct Component Access
>> /// @{
>>
>> Modified: llvm/trunk/lib/Support/Triple.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=156483&r1=156482&r2=156483&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Support/Triple.cpp (original)
>> +++ llvm/trunk/lib/Support/Triple.cpp Wed May 9 12:23:48 2012
>> @@ -596,6 +596,27 @@
>> return true;
>> }
>>
>> +void Triple::getiOSVersion(unsigned &Major, unsigned &Minor,
>> + unsigned &Micro) const {
>> + switch (getOS()) {
>> + default: llvm_unreachable("unexpected OS for Darwin triple");
>> + case Darwin:
>> + case MacOSX:
>> + // Ignore the version from the triple. This is only handled because the
>> + // the clang driver combines OS X and IOS support into a common Darwin
>> + // toolchain that wants to know the iOS version number even when targeting
>> + // OS X.
>> + Major = 0;
>> + Minor = 0;
>> + Micro = 0;
>> + return true;
>
> Does this return statement actually compile?
It does compile, but with a warning. I'll take care of it.
Chad
> -Eli
More information about the llvm-commits
mailing list