r212176 - [Driver][Mips] If ABI name is not provided deduce it from the target triple

Simon Atanasyan simon at atanasyan.com
Wed Jul 23 02:41:46 PDT 2014


On Wed, Jul 23, 2014 at 1:45 AM, Justin Bogner <mail at justinbogner.com> wrote:
> Simon Atanasyan <simon at atanasyan.com> writes:
>> Author: atanasyan
>> Date: Wed Jul  2 08:20:36 2014
>> New Revision: 212176

[...]

>> +++ cfe/trunk/lib/Driver/Tools.cpp Wed Jul  2 08:20:36 2014
>> @@ -947,22 +947,22 @@ static void getMipsCPUAndABI(const ArgLi
>>      }
>>    }
>>
>> -  if (!ABIName.empty()) {
>> +  if (ABIName.empty()) {
>> +    // Deduce ABI name from the target triple.
>> +    if (Triple.getArch() == llvm::Triple::mips ||
>> +        Triple.getArch() == llvm::Triple::mipsel)
>> +      ABIName = "o32";
>> +    else
>> +      ABIName = "n64";
>> +  }
>> +
>> +  if (CPUName.empty()) {
>>      // Deduce CPU name from ABI name.
>>      CPUName = llvm::StringSwitch<const char *>(ABIName)
>>        .Cases("o32", "eabi", DefMips32CPU)
>>        .Cases("n32", "n64", DefMips64CPU)
>>        .Default("");
>>    }
>> -  else if (!CPUName.empty()) {
>> -    // Deduce ABI name from CPU name.
>> -    ABIName = llvm::StringSwitch<const char *>(CPUName)
>> -      .Cases("mips32", "mips32r2", "o32")
>> -      .Cases("mips64", "mips64r2", "n64")
>> -      .Default("");
>> -  }
>> -
>> -  // FIXME: Warn on inconsistent cpu and abi usage.
>
> Did you mean to remove this FIXME?

It was removed accidentally. Fixed at r213734. Thanks to catch this.

-- 
Simon Atanasyan



More information about the cfe-commits mailing list