[PATCH] D105118: [remangleIntrinsicFunction] Detect and resolve name clash
Jeroen Dobbelaere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 30 10:30:30 PDT 2021
jeroen.dobbelaere added inline comments.
================
Comment at: llvm/lib/IR/Function.cpp:1667
+ Function *NewDecl = nullptr;
+ if (auto *ExistingGV = F->getParent()->getNamedValue(WantedName)) {
+ if (auto *ExistingF = dyn_cast<Function>(ExistingGV))
----------------
apilipenko wrote:
> I think it should be remangleIntrinsicFunction caller responsibility to do this kind of adjustment. Some of the callers (like LLParser) will just assert that the resulting function matches the signature. Others, like bitcode reader, will need to handle this situation.
Even in the LLParser use case, I think we can end up in a similar situation: a first rewrite could end up in a name clash with a function that is only rewritten later.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105118/new/
https://reviews.llvm.org/D105118
More information about the llvm-commits
mailing list