-
Notifications
You must be signed in to change notification settings - Fork 442
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
Preserve the original name when renaming declarations in the inlining pass. #4683
base: main
Are you sure you want to change the base?
Conversation
The differences in the DPDK output indicates that that backend may be incorrectly using the name of a symbol when it should be using the externalName. This change is causing it to use the unqualified name instead of a the fully qualified name. |
Yes, the DPDK uses @hanw Do you know whether there is still someone involved with the DPDK back end? |
811ed51
to
a9726e7
Compare
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.
Looks good to me.
|
||
public: | ||
void setNewName(const IR::IDeclaration *decl, cstring name, cstring extName) { | ||
CHECK_NULL(decl); | ||
BUG_CHECK(!name.isNullOrEmpty() && !extName.isNullOrEmpty(), "Empty name"); | ||
LOG3("setNewName " << dbp(decl) << " to " << name); | ||
if (internalName.find(decl) != internalName.end()) BUG("%1%: already renamed", decl); | ||
internalName.emplace(decl, name); | ||
externalName.emplace(decl, extName); | ||
internalName.emplace(decl, IR::ID(name, decl->toString())); |
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.
maybe we shuld rather do something like decl->name.originalName
here? Using toString
might be fragile.
Fixes #4444.