Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow collapsing non-ambiguous operator symbols #86

Open
aeckert opened this issue Mar 17, 2022 · 1 comment
Open

Allow collapsing non-ambiguous operator symbols #86

aeckert opened this issue Mar 17, 2022 · 1 comment

Comments

@aeckert
Copy link

aeckert commented Mar 17, 2022

I have a case where I have a bunch of templated classes that have potentially expensive operator() implementations. However, due to how we collapse names, we never collapse any operators at all and we don't end up grouping these when highlight expensive template instantiation patterns. Relevant code is here:

...
static std::string_view CollapseName(const std::string_view& elt)
{
    // Parsing op<, op<<, op>, and op>> seems hard.  Just skip'm all
    if (elt.find("operator") != std::string::npos)
      return elt;
...

I'm wondering if we can change this to only prevent collapsing if we find either 'operator<' or 'operator>' in the name so that we can surface something like this.

@ben-craig
Copy link

Seems reasonable. I vaguely recall running into some cases where there were spaces between operator and the op type.

Put together a PR and we can look at it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants