llvm.org GIT mirror llvm / 9981739
[Attributor][Fix] Never override given argument numbers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366009 91177308-0d34-0410-b5e6-96231b3b80d8 Johannes Doerfert a month ago
1 changed file(s) with 8 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
181181 // Determine the argument number automatically for llvm::Arguments if none
182182 // is set. Do not override a given one as it could be a use of the argument
183183 // in a call site.
184 if (auto *Arg = dyn_cast(&V))
185 if (ArgNo == -1)
184 if (ArgNo == -1)
185 if (auto *Arg = dyn_cast(&V))
186186 ArgNo = Arg->getArgNo();
187187
188188 // If a function was given together with an argument number, perform the
231231 "'AbstractAttribute'!");
232232
233233 // Determine the anchor value and the argument number which are used to
234 // lookup the attribute together with AAType::ID.
234 // lookup the attribute together with AAType::ID. If passed an argument,
235 // use its argument number but do not override a given one as it could be a
236 // use of the argument at a call site.
235237 Value &AnchoredVal = AA.getAnchoredValue();
236 if (auto *Arg = dyn_cast(&AnchoredVal))
237 ArgNo = Arg->getArgNo();
238 if (ArgNo == -1)
239 if (auto *Arg = dyn_cast(&AnchoredVal))
240 ArgNo = Arg->getArgNo();
238241
239242 // Put the attribute in the lookup map structure and the container we use to
240243 // keep track of all attributes.