aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-07-01 10:56:37 -0700
committerIan Lance Taylor <iant@golang.org>2022-07-01 13:38:08 -0700
commit1f76941c09f6f62f4cbf7a9f531ec95268dd2c0a (patch)
treede468e6956f2354b019defe0e7c940c7a8a9ad10 /gcc/go
parentecd11acacd6be57af930fa617d7c31ecb40e7f74 (diff)
downloadgcc-1f76941c09f6f62f4cbf7a9f531ec95268dd2c0a.zip
gcc-1f76941c09f6f62f4cbf7a9f531ec95268dd2c0a.tar.gz
gcc-1f76941c09f6f62f4cbf7a9f531ec95268dd2c0a.tar.bz2
compiler: rename "requires" to "needs"
As of C++20 "requires" is a C++ keyword. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415754
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/gogo.cc12
-rw-r--r--gcc/go/gofrontend/types.cc20
3 files changed, 17 insertions, 17 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 0d49e9e..65f64e0f 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-548720bca6bff21ebc9aba22249d9ce45bbd90c7
+ac438edc5335f69c95df9342f43712ad2f61ad66
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index e13df0d..67b91fa 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -5302,16 +5302,16 @@ Gogo::write_c_header()
Named_object* no = types.front();
types.pop_front();
- std::vector<const Named_object*> requires;
+ std::vector<const Named_object*> needs;
std::vector<const Named_object*> declare;
- if (!no->type_value()->struct_type()->can_write_to_c_header(&requires,
+ if (!no->type_value()->struct_type()->can_write_to_c_header(&needs,
&declare))
continue;
bool ok = true;
for (std::vector<const Named_object*>::const_iterator pr
- = requires.begin();
- pr != requires.end() && ok;
+ = needs.begin();
+ pr != needs.end() && ok;
++pr)
{
for (std::list<Named_object*>::const_iterator pt = types.begin();
@@ -5342,10 +5342,10 @@ Gogo::write_c_header()
if (*pd == no)
continue;
- std::vector<const Named_object*> drequires;
+ std::vector<const Named_object*> dneeds;
std::vector<const Named_object*> ddeclare;
if (!(*pd)->type_value()->struct_type()->
- can_write_to_c_header(&drequires, &ddeclare))
+ can_write_to_c_header(&dneeds, &ddeclare))
continue;
bool done = false;
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index e82be68..4995283 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -6967,7 +6967,7 @@ Struct_type::do_import(Import* imp)
bool
Struct_type::can_write_to_c_header(
- std::vector<const Named_object*>* requires,
+ std::vector<const Named_object*>* needs,
std::vector<const Named_object*>* declare) const
{
const Struct_field_list* fields = this->fields_;
@@ -6978,7 +6978,7 @@ Struct_type::can_write_to_c_header(
p != fields->end();
++p)
{
- if (!this->can_write_type_to_c_header(p->type(), requires, declare))
+ if (!this->can_write_type_to_c_header(p->type(), needs, declare))
return false;
if (Gogo::message_name(p->field_name()) == "_")
sinks++;
@@ -6993,7 +6993,7 @@ Struct_type::can_write_to_c_header(
bool
Struct_type::can_write_type_to_c_header(
const Type* t,
- std::vector<const Named_object*>* requires,
+ std::vector<const Named_object*>* needs,
std::vector<const Named_object*>* declare) const
{
t = t->forwarded();
@@ -7027,13 +7027,13 @@ Struct_type::can_write_type_to_c_header(
return true;
case TYPE_STRUCT:
- return t->struct_type()->can_write_to_c_header(requires, declare);
+ return t->struct_type()->can_write_to_c_header(needs, declare);
case TYPE_ARRAY:
if (t->is_slice_type())
return true;
return this->can_write_type_to_c_header(t->array_type()->element_type(),
- requires, declare);
+ needs, declare);
case TYPE_NAMED:
{
@@ -7049,10 +7049,10 @@ Struct_type::can_write_type_to_c_header(
// We will accept empty struct fields, but not print them.
if (t->struct_type()->total_field_count() == 0)
return true;
- requires->push_back(no);
- return t->struct_type()->can_write_to_c_header(requires, declare);
+ needs->push_back(no);
+ return t->struct_type()->can_write_to_c_header(needs, declare);
}
- return this->can_write_type_to_c_header(t->base(), requires, declare);
+ return this->can_write_type_to_c_header(t->base(), needs, declare);
}
case TYPE_CALL_MULTIPLE_RESULT:
@@ -7150,9 +7150,9 @@ Struct_type::write_field_to_c_header(std::ostream& os, const std::string& name,
case TYPE_POINTER:
{
- std::vector<const Named_object*> requires;
+ std::vector<const Named_object*> needs;
std::vector<const Named_object*> declare;
- if (!this->can_write_type_to_c_header(t->points_to(), &requires,
+ if (!this->can_write_type_to_c_header(t->points_to(), &needs,
&declare))
os << "void*";
else