-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
I'm happy to hear suggestions for changing the strings, particularly if you have a good idea for making names shorter. For example, maybe |
toolchain/sem_ir/inst_namer.cpp
Outdated
case CARBON_KIND(InterfaceWitnessAccess inst): { | ||
std::string name; | ||
llvm::raw_string_ostream out(name); | ||
out << "elt" << inst.index.index; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
toolchain/sem_ir/inst_namer.cpp
Outdated
case CARBON_KIND(TupleAccess inst): { | ||
std::string name; | ||
llvm::raw_string_ostream out(name); | ||
out << "telt" << inst.index.index; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Goal is to reduce churn in names in test updates (by churning a lot of them in this PR).