[PATCH] Pretty print template arg enum constants (if possible)

Will Wilson will at indefiant.com
Fri Dec 12 20:40:21 PST 2014


Thanks Richard!

Committed with getAs<> fix as r224184. Fixed the * placement in r224185 due
to lack of attention on my part....

Will.

On 13 December 2014 at 08:46, Richard Smith <richard at metafoo.co.uk> wrote:

> +  if (const EnumType* ET = dyn_cast<EnumType>(T)) {
>
> * on the right please, and use T->getAs<EnumType>() in case there is type
> sugar here (there probably can't be for a TemplateArgument that's been
> resolved to an integral value, but dyn_cast on a type is a red flag that we
> don't need here).
>
> Otherwise, LGTM, thanks!
>
> On Thu, Dec 11, 2014 at 8:28 PM, Will Wilson <will at indefiant.com> wrote:
>
>> Hi Richard,
>>
>> Here's a simple patch that improves pretty printing for templates args
>> specialized to enum constants. If an enum constant isn't available to
>> represent the value it falls back on printing the integer value.
>>
>> Tested against latest trunk and includes a new test case and a updated
>> existing test case.
>>
>> Let me know if it looks good to go...
>>
>> Cheers,
>> Will.
>>
>
>


-- 
*Indefiant *: http://www.indefiant.com
Home of Recode : Runtime C++ Editing for VS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141213/ec8ca9e6/attachment.html>


More information about the cfe-commits mailing list