xref: /netbsd-src/external/gpl3/binutils/dist/gold/cref.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
12a6b7db3Sskrll // cref.h -- cross reference reports for gold   -*- C++ -*-
22a6b7db3Sskrll 
3*cb63e24eSchristos // Copyright (C) 2008-2024 Free Software Foundation, Inc.
42a6b7db3Sskrll // Written by Ian Lance Taylor <iant@google.com>.
52a6b7db3Sskrll 
62a6b7db3Sskrll // This file is part of gold.
72a6b7db3Sskrll 
82a6b7db3Sskrll // This program is free software; you can redistribute it and/or modify
92a6b7db3Sskrll // it under the terms of the GNU General Public License as published by
102a6b7db3Sskrll // the Free Software Foundation; either version 3 of the License, or
112a6b7db3Sskrll // (at your option) any later version.
122a6b7db3Sskrll 
132a6b7db3Sskrll // This program is distributed in the hope that it will be useful,
142a6b7db3Sskrll // but WITHOUT ANY WARRANTY; without even the implied warranty of
152a6b7db3Sskrll // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
162a6b7db3Sskrll // GNU General Public License for more details.
172a6b7db3Sskrll 
182a6b7db3Sskrll // You should have received a copy of the GNU General Public License
192a6b7db3Sskrll // along with this program; if not, write to the Free Software
202a6b7db3Sskrll // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
212a6b7db3Sskrll // MA 02110-1301, USA.
222a6b7db3Sskrll 
232a6b7db3Sskrll #ifndef GOLD_CREF_H
242a6b7db3Sskrll #define GOLD_CREF_H
252a6b7db3Sskrll 
26be12b8bcSchristos #include <cstdio>
27be12b8bcSchristos 
282a6b7db3Sskrll namespace gold
292a6b7db3Sskrll {
302a6b7db3Sskrll 
312a6b7db3Sskrll class Object;
322a6b7db3Sskrll class Archive;
332a6b7db3Sskrll class Cref_inputs;
342a6b7db3Sskrll 
352a6b7db3Sskrll // This class collects data for cross reference and other reporting.
362a6b7db3Sskrll 
372a6b7db3Sskrll class Cref
382a6b7db3Sskrll {
392a6b7db3Sskrll  public:
Cref()402a6b7db3Sskrll   Cref()
412a6b7db3Sskrll     : inputs_(NULL)
422a6b7db3Sskrll   { }
432a6b7db3Sskrll 
442a6b7db3Sskrll   // Record an input object file.  This is called for each object file
452a6b7db3Sskrll   // in the order in which it is processed.
462a6b7db3Sskrll   void
472a6b7db3Sskrll   add_object(Object*);
482a6b7db3Sskrll 
492a6b7db3Sskrll   // Start recording an input archive.  This is called for each
502a6b7db3Sskrll   // archive in the order in which it appears on the command line.  A
512a6b7db3Sskrll   // call to add_archive_start precedes calls to add_object for each
522a6b7db3Sskrll   // object included from the archive.
532a6b7db3Sskrll   void
542a6b7db3Sskrll   add_archive_start(Archive*);
552a6b7db3Sskrll 
562a6b7db3Sskrll   // Finish recording an input archive.  This is called after
572a6b7db3Sskrll   // add_object has been called for each object included from the
582a6b7db3Sskrll   // archive.
592a6b7db3Sskrll   void
602a6b7db3Sskrll   add_archive_stop(Archive*);
612a6b7db3Sskrll 
622a6b7db3Sskrll   // Print symbol counts.
632a6b7db3Sskrll   void
642a6b7db3Sskrll   print_symbol_counts(const Symbol_table*) const;
652a6b7db3Sskrll 
66be12b8bcSchristos   // Print a cross reference table.
67be12b8bcSchristos   void
68be12b8bcSchristos   print_cref(const Symbol_table*, FILE*) const;
69be12b8bcSchristos 
702a6b7db3Sskrll  private:
712a6b7db3Sskrll   void
722a6b7db3Sskrll   need_inputs();
732a6b7db3Sskrll 
742a6b7db3Sskrll   Cref_inputs* inputs_;
752a6b7db3Sskrll };
762a6b7db3Sskrll 
772a6b7db3Sskrll } // End namespace gold.
782a6b7db3Sskrll 
792a6b7db3Sskrll #endif // !defined(GOLD_CREF_H)
80