This is an archive of the discontinued LLVM Phabricator instance.

Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
ClosedPublic

Authored by mspertus on Mar 14 2016, 3:22 PM.

Details

Summary

This adds visualizers for PointerType and TemplateTypeParmType.

As I have been using these visualizers, I have found the DisplayStrings to be too verbose to cleanly see in the Locals Window, so I have changed the Display Strings to display in a more C++-like style. For example, instead of a SubstTemplateTypeParmType displaying as

SubstTemplateTypeParmType: {Identifier (("T"))} => Record (25), {Identifier (("A"))}

it now displays more readably as

SubstTemplateTypeParmType: {typename T <= struct A}

The <expand> sections still can be used for all the gory details if necessary

Diff Detail

Event Timeline

mspertus updated this revision to Diff 50658.Mar 14 2016, 3:22 PM
mspertus retitled this revision from to Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types.
mspertus updated this object.
mspertus added reviewers: aaron.ballman, zturner.
mspertus added a subscriber: cfe-commits.
aaron.ballman added inline comments.Mar 16 2016, 6:56 AM
clang.natvis
25

If we're handling pointers, perhaps we should also do references similarly? Also, perhaps functions as well (bonus points if you can suss out the function prototype and display it!)?

26

I think this should be TypeBits.TC==clang::Type::TypeClass::Attributed instead.

mspertus updated this revision to Diff 50820.Mar 16 2016, 7:08 AM

Added reference types and a more accurate AttributedType enum. I am working on additional items for the future (class members, function types, etc.) but those will take longer, and I think it is worthwhile to get this revision committed unless there are defects in it. Agree?

mspertus added inline comments.Mar 16 2016, 7:12 AM
clang.natvis
25

I've already written references and can slot into an updated diff. After that, I plan on adding members of classes, but I'd like to put that in a subsequent change. Function prototype display is also coming. Does that sound ok?

26

Fixed

aaron.ballman accepted this revision.Mar 16 2016, 7:24 AM
aaron.ballman edited edge metadata.

Added reference types and a more accurate AttributedType enum. I am working on additional items for the future (class members, function types, etc.) but those will take longer, and I think it is worthwhile to get this revision committed unless there are defects in it. Agree?

Definitely agree. This LGTM now, thank you!

This revision is now accepted and ready to land.Mar 16 2016, 7:24 AM

Committed as revision 263638. At Chandler's suggestion, I am going to send an announcement to cfe-dev letting people know of all of the recent improvements to native visualizers

mspertus closed this revision.Mar 16 2016, 1:21 PM

Forgot to close the revision