* configure.tgt (powerpc64-*): Fix targ_obj.
[binutils-gdb.git] / gold / errors.h
index 545c463bad31568fe1df813b62c9cbf4da1995be..b373a06a4f7236f806b173d98ae5d78ddab82d8d 100644 (file)
@@ -1,6 +1,6 @@
 // errors.h -- handle errors for gold  -*- C++ -*-
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -57,6 +57,10 @@ class Errors
   void
   warning(const char* format, va_list);
 
+  // Print an informational message and continue.
+  void
+  info(const char* format, va_list);
+
   // Report an error at a reloc location.
   template<int size, bool big_endian>
   void
@@ -80,15 +84,34 @@ class Errors
                   const Relocate_info<size, big_endian>* relinfo,
                   size_t relnum, off_t reloffset);
 
+  // Report a debugging message.
+  void
+  debug(const char* format, ...) ATTRIBUTE_PRINTF_2;
+
   // Return the number of errors.
   int
   error_count() const
   { return this->error_count_; }
 
+  // Return the number of warnings.
+  int
+  warning_count() const
+  { return this->warning_count_; }
+
  private:
   Errors(const Errors&);
   Errors& operator=(const Errors&);
 
+  // Initialize the lock.  We don't do this in the constructor because
+  // lock initialization wants to know whether we are using threads or
+  // not.  This returns true if the lock is now initialized.
+  bool
+  initialize_lock();
+
+  // Increment a counter, holding the lock.
+  void
+  increment_counter(int*);
+
   // The number of times we report an undefined symbol.
   static const int max_undefined_error_report = 5;
 
@@ -96,7 +119,7 @@ class Errors
   const char* program_name_;
   // This class can be accessed from multiple threads.  This lock is
   // used to control access to the data structures.
-  Lock lock_;
+  Lock* lock_;
   // Numbers of errors reported.
   int error_count_;
   // Number of warnings reported.