Define go_assert to replace gcc_assert
[gcc.git] / gcc / go / gofrontend / export.cc
index cbf24b84025cb8583322f45523fea10fde3f9a7e..538fb97ce6806f63b94bdacee512616d01d171f8 100644 (file)
@@ -266,7 +266,7 @@ Export::write_type(const Type* type)
     {
       // This type was already in the table.
       int index = p->second;
-      gcc_assert(index != 0);
+      go_assert(index != 0);
       char buf[30];
       snprintf(buf, sizeof buf, "<type %d>", index);
       this->write_c_string(buf);
@@ -289,7 +289,7 @@ Export::write_type(const Type* type)
       if (named_type != NULL)
        {
          // The builtin types should have been predefined.
-         gcc_assert(named_type->location() != BUILTINS_LOCATION
+         go_assert(named_type->location() != BUILTINS_LOCATION
                     || (named_type->named_object()->package()->name()
                         == "unsafe"));
          named_object = named_type->named_object();
@@ -355,16 +355,16 @@ void
 Export::register_builtin_type(Gogo* gogo, const char* name, Builtin_code code)
 {
   Named_object* named_object = gogo->lookup_global(name);
-  gcc_assert(named_object != NULL && named_object->is_type());
+  go_assert(named_object != NULL && named_object->is_type());
   std::pair<Type_refs::iterator, bool> ins =
     this->type_refs_.insert(std::make_pair(named_object->type_value(), code));
-  gcc_assert(ins.second);
+  go_assert(ins.second);
 
   // We also insert the underlying type.  We can see the underlying
   // type at least for string and bool.
   Type* real_type = named_object->type_value()->real_type();
   ins = this->type_refs_.insert(std::make_pair(real_type, code));
-  gcc_assert(ins.second);
+  go_assert(ins.second);
 }
 
 // Class Export::Stream.
@@ -428,7 +428,7 @@ Stream_to_section::do_write(const char* bytes, size_t length)
   section* sec = (section*) this->section_;
   if (sec == NULL)
     {
-      gcc_assert(targetm.have_named_sections);
+      go_assert(targetm.have_named_sections);
 
       sec = get_section(".go_export", SECTION_DEBUG, NULL);
       this->section_ = (void*) sec;