llvm.org GIT mirror llvm / 5968ac8
[Attributor][FIX] Lookup of (call site) argument attributes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365977 91177308-0d34-0410-b5e6-96231b3b80d8 Johannes Doerfert a month ago
1 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
178178 assert(AAType::ID != Attribute::None &&
179179 "Cannot lookup generic abstract attributes!");
180180
181 // Determine the argument number automatically for llvm::Arguments.
181 // Determine the argument number automatically for llvm::Arguments if none
182 // is set. Do not override a given one as it could be a use of the argument
183 // in a call site.
182184 if (auto *Arg = dyn_cast(&V))
183 ArgNo = Arg->getArgNo();
185 if (ArgNo == -1)
186 ArgNo = Arg->getArgNo();
184187
185188 // If a function was given together with an argument number, perform the
186189 // lookup for the actual argument instead. Don't do it for variadic