This is an archive of the discontinued LLVM Phabricator instance.

Allow SyntheticChildFrontEnd's to request that they always get an object, nor a reference or pointer
ClosedPublic

Authored by jingham on Jul 12 2018, 7:16 PM.

Details

Summary

Some of the cxx synthetic child providers (for vector, set, multiset and bitset) were implicitly assuming that the object they received to format was an object, not a pointer or reference to an object, even though the pattern they used matched pointers and references.

Since that seems a handy simplification for the child provider, I added a flag to the provider flags to request that they always get an object, and made the generic front end runner code do the dereference before handing the ValueObject off to the provider.

Also added tests to all the failing formatters to ensure that they work with pointers and references.

Diff Detail

Repository
rL LLVM

Event Timeline

jingham created this revision.Jul 12 2018, 7:16 PM
JDevlieghere accepted this revision.Jul 13 2018, 3:28 AM

LGTM with a nit for the test function name. Thanks Jim!

packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
30 ↗(On Diff #155311)

Should we call this check_bitset? I had no idea what the ii here meant until I found the call that checks the variable with the same name. (and later we call it for a different variable names for the ref/ptr case.

This revision is now accepted and ready to land.Jul 13 2018, 3:28 AM
jingham updated this revision to Diff 155425.Jul 13 2018, 10:25 AM

Add an explanatory comment for the check_ii routine.

I didn't want to make check_ii sound general with a name like check_bitset. This isn't some general bitset check routine, it asserts the state of the particular bitset held in ii at a particular point in the program execution. The only reason to extract the test into a routine was to apply the exact same test for the contents of ii when it appeared as that object or as a reference to it. For that reason I'm not unhappy with the name, but I added a comment explaining what the routine does. Does that make it clearer?

This revision was automatically updated to reflect the committed changes.

It looks like a couple of the new tests don't have @add_test_categories(["libc++"]) and they are failing on Windows. Are they supposed to run and pass without libc++?

Nope, that was just an oversight. I'll fix it if you don't beat me to it...

I think r337058 should do. Sorry for the trouble.

Thanks for the quick fix!