Update for LLVM API removal of Function::getArgumentList()

llvm-svn: 298011
This commit is contained in:
Reid Kleckner 2017-03-16 23:13:49 +00:00
parent 45707d4d5a
commit 20670ba52c
2 changed files with 6 additions and 7 deletions

View File

@ -1853,9 +1853,9 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
if (!m_decl_map->GetStructInfo(num_elements, size, alignment))
return false;
Function::arg_iterator iter(llvm_function.getArgumentList().begin());
Function::arg_iterator iter(llvm_function.arg_begin());
if (iter == llvm_function.getArgumentList().end()) {
if (iter == llvm_function.arg_end()) {
m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes no "
"arguments (should take at least a struct pointer)");
@ -1867,7 +1867,7 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
if (argument->getName().equals("this")) {
++iter;
if (iter == llvm_function.getArgumentList().end()) {
if (iter == llvm_function.arg_end()) {
m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes only "
"'this' argument (should take a struct pointer "
"too)");
@ -1879,7 +1879,7 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
} else if (argument->getName().equals("self")) {
++iter;
if (iter == llvm_function.getArgumentList().end()) {
if (iter == llvm_function.arg_end()) {
m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes only "
"'self' argument (should take '_cmd' and a struct "
"pointer too)");
@ -1897,7 +1897,7 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
++iter;
if (iter == llvm_function.getArgumentList().end()) {
if (iter == llvm_function.arg_end()) {
m_error_stream.Printf("Internal error [IRForTarget]: Wrapper takes only "
"'self' and '_cmd' arguments (should take a struct "
"pointer too)");

View File

@ -267,8 +267,7 @@ bool fixupRSAllocationStructByValCalls(llvm::Module &module) {
// for all called function decls
for (auto func : rs_functions) {
// inspect all of the arguments in the call
llvm::SymbolTableList<llvm::Argument> &arg_list = func->getArgumentList();
for (auto &arg : arg_list) {
for (auto &arg : func->args()) {
if (arg.hasByValAttr()) {
arg.removeAttr(attr_byval);
changed = true;