Commit cc3a4325 authored by Vicent Marti's avatar Vicent Marti

cc/clang: Use positional arguments for diagnostic messages

parent 330e4f2b
...@@ -306,7 +306,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { ...@@ -306,7 +306,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
for (; table_it != tables_.end(); ++table_it) for (; table_it != tables_.end(); ++table_it)
if (table_it->name == Ref->getDecl()->getName()) break; if (table_it->name == Ref->getDecl()->getName()) break;
if (table_it == tables_.end()) { if (table_it == tables_.end()) {
error(Ref->getLocEnd(), "bpf_table %s failed to open") << Ref->getDecl()->getName(); error(Ref->getLocEnd(), "bpf_table %0 failed to open") << Ref->getDecl()->getName();
return false; return false;
} }
string fd = to_string(table_it->fd); string fd = to_string(table_it->fd);
...@@ -380,7 +380,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { ...@@ -380,7 +380,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
prefix = "bpf_perf_event_read"; prefix = "bpf_perf_event_read";
suffix = ")"; suffix = ")";
} else { } else {
error(Call->getLocStart(), "invalid bpf_table operation %s") << memb_name; error(Call->getLocStart(), "invalid bpf_table operation %0") << memb_name;
return false; return false;
} }
prefix += "((void *)bpf_pseudo_fd(1, " + fd + "), "; prefix += "((void *)bpf_pseudo_fd(1, " + fd + "), ";
...@@ -617,7 +617,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) { ...@@ -617,7 +617,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
table.fd = bpf_create_map(map_type, table.key_size, table.leaf_size, table.max_entries); table.fd = bpf_create_map(map_type, table.key_size, table.leaf_size, table.max_entries);
} }
if (table.fd < 0) { if (table.fd < 0) {
error(Decl->getLocStart(), "could not open bpf map: %0\nis %s map type enabled in your kernel?") << error(Decl->getLocStart(), "could not open bpf map: %0\nis %1 map type enabled in your kernel?") <<
strerror(errno) << A->getName(); strerror(errno) << A->getName();
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment