[cfe-commits] r156826 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaChecking.cpp test/Analysis/array-struct-region.c test/CXX/expr/expr.unary/expr.unary.op/p6.cpp test/CXX/temp/temp.spec/p5.cpp test/PCH/exprs.h test/Sem

David Blaikie dblaikie at gmail.com
Tue May 15 10:19:49 PDT 2012


On Tue, May 15, 2012 at 10:06 AM, Jordan Rose <jediknil at belkadan.com> wrote:
>
> On May 15, 2012, at 12:56, David Blaikie wrote:
>
>> +  SmallString<16> PrettySourceValue;
>> +  Value.toString(PrettySourceValue);
>> +  std::string PrettyTargetValue;
>> +  if (T->isSpecificBuiltinType(BuiltinType::Bool))
>> +    PrettyTargetValue = IntegerValue == 0 ? "false" : "true";
>> +  else
>> +    PrettyTargetValue = IntegerValue.toString(10);
>> +
>
> Why the std::string for the target?
>
> SmallString<16> PrettyTargetValue;
> if (T->isSpecificBuiltinType(BuiltinType::Bool))
>  PrettyTargetValue = (IntegerValue == 0) ? "false" : "true";
> else
>  IntegerValue.toString(PrettyTargetValue);
>
> (The base defaults to 10 for this version of toString.)

Handy - just didn't see the toString(SmallString) version. Changed as
suggested in r156827.

Thanks,
- David




More information about the cfe-commits mailing list