1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[Attributor][FIX] Lookup of (call site) argument attributes

llvm-svn: 365977
This commit is contained in:
Johannes Doerfert 2019-07-13 00:09:27 +00:00
parent 70b8986c96
commit 1edf4f3db1

View File

@ -179,9 +179,12 @@ struct Attributor {
assert(AAType::ID != Attribute::None && assert(AAType::ID != Attribute::None &&
"Cannot lookup generic abstract attributes!"); "Cannot lookup generic abstract attributes!");
// Determine the argument number automatically for llvm::Arguments. // Determine the argument number automatically for llvm::Arguments if none
// is set. Do not override a given one as it could be a use of the argument
// in a call site.
if (auto *Arg = dyn_cast<Argument>(&V)) if (auto *Arg = dyn_cast<Argument>(&V))
ArgNo = Arg->getArgNo(); if (ArgNo == -1)
ArgNo = Arg->getArgNo();
// If a function was given together with an argument number, perform the // If a function was given together with an argument number, perform the
// lookup for the actual argument instead. Don't do it for variadic // lookup for the actual argument instead. Don't do it for variadic