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

More instructions get named #4615

Merged
merged 25 commits into from
Dec 3, 2024
Merged

More instructions get named #4615

merged 25 commits into from
Dec 3, 2024

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Dec 3, 2024

Goal is to reduce churn in names in test updates (by churning a lot of them in this PR).

@josh11b
Copy link
Contributor Author

josh11b commented Dec 3, 2024

I'm happy to hear suggestions for changing the strings, particularly if you have a good idea for making names shorter. For example, maybe %_32 is understandable enough we don't need to write %int_32?

case CARBON_KIND(InterfaceWitnessAccess inst): {
std::string name;
llvm::raw_string_ostream out(name);
out << "elt" << inst.index.index;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use "elt" in a couple of other places. Is there a more specific name we could give this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a letter to the beginning, like ielt, I didn't do that at first since I was worried that would be too mysterious. I've made that change, so you can see how it looks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a little mysterious from the value name alone, but I think from the instruction name interface_witness_access it's reasonably clear what it means. Maybe we'll find a better name later but this seems good enough for now.

Copy link
Contributor

@jonmeow jonmeow Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do tuple.elem. Maybe elem since it's consistent with current use and the C++ style guide advises against abbreviation by removing letters in the middle?

Maybe impl.elem? (similar to how tuple access gives a tuple element, witness access giving an impl element)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

case CARBON_KIND(TupleAccess inst): {
std::string name;
llvm::raw_string_ostream out(name);
out << "telt" << inst.index.index;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, I'd suggest a similar rename here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@josh11b josh11b enabled auto-merge December 3, 2024 20:43
@josh11b josh11b added this pull request to the merge queue Dec 3, 2024
Merged via the queue into carbon-language:trunk with commit 5d1b39e Dec 3, 2024
8 checks passed
@josh11b josh11b deleted the name branch December 3, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants