cref.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // cref.h -- cross reference reports for gold -*- C++ -*-
  2. // Copyright (C) 2008-2022 Free Software Foundation, Inc.
  3. // Written by Ian Lance Taylor <iant@google.com>.
  4. // This file is part of gold.
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 3 of the License, or
  8. // (at your option) any later version.
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  16. // MA 02110-1301, USA.
  17. #ifndef GOLD_CREF_H
  18. #define GOLD_CREF_H
  19. #include <cstdio>
  20. namespace gold
  21. {
  22. class Object;
  23. class Archive;
  24. class Cref_inputs;
  25. // This class collects data for cross reference and other reporting.
  26. class Cref
  27. {
  28. public:
  29. Cref()
  30. : inputs_(NULL)
  31. { }
  32. // Record an input object file. This is called for each object file
  33. // in the order in which it is processed.
  34. void
  35. add_object(Object*);
  36. // Start recording an input archive. This is called for each
  37. // archive in the order in which it appears on the command line. A
  38. // call to add_archive_start precedes calls to add_object for each
  39. // object included from the archive.
  40. void
  41. add_archive_start(Archive*);
  42. // Finish recording an input archive. This is called after
  43. // add_object has been called for each object included from the
  44. // archive.
  45. void
  46. add_archive_stop(Archive*);
  47. // Print symbol counts.
  48. void
  49. print_symbol_counts(const Symbol_table*) const;
  50. // Print a cross reference table.
  51. void
  52. print_cref(const Symbol_table*, FILE*) const;
  53. private:
  54. void
  55. need_inputs();
  56. Cref_inputs* inputs_;
  57. };
  58. } // End namespace gold.
  59. #endif // !defined(GOLD_CREF_H)