Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.3 KiB

  1. //===- ProfileInfoLoader.h - Load & convert profile information -*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // The ProfileInfoLoader class is used to load and represent profiling
  11. // information read in from the dump file. If conversions between formats are
  12. // needed, it can also do this.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #ifndef LLVM_ANALYSIS_PROFILEINFOLOADER_H
  16. #define LLVM_ANALYSIS_PROFILEINFOLOADER_H
  17. #include <string>
  18. #include <utility>
  19. #include <vector>
  20. namespace llvm {
  21. class Module;
  22. class Function;
  23. class BasicBlock;
  24. class ProfileInfoLoader {
  25. const std::string &Filename;
  26. std::vector<std::string> CommandLines;
  27. std::vector<unsigned> FunctionCounts;
  28. std::vector<unsigned> BlockCounts;
  29. std::vector<unsigned> EdgeCounts;
  30. std::vector<unsigned> OptimalEdgeCounts;
  31. std::vector<unsigned> BBTrace;
  32. public:
  33. // ProfileInfoLoader ctor - Read the specified profiling data file, exiting
  34. // the program if the file is invalid or broken.
  35. ProfileInfoLoader(const char *ToolName, const std::string &Filename);
  36. static const unsigned Uncounted;
  37. unsigned getNumExecutions() const { return CommandLines.size(); }
  38. const std::string &getExecution(unsigned i) const { return CommandLines[i]; }
  39. const std::string &getFileName() const { return Filename; }
  40. // getRawFunctionCounts - This method is used by consumers of function
  41. // counting information.
  42. //
  43. const std::vector<unsigned> &getRawFunctionCounts() const {
  44. return FunctionCounts;
  45. }
  46. // getRawBlockCounts - This method is used by consumers of block counting
  47. // information.
  48. //
  49. const std::vector<unsigned> &getRawBlockCounts() const {
  50. return BlockCounts;
  51. }
  52. // getEdgeCounts - This method is used by consumers of edge counting
  53. // information.
  54. //
  55. const std::vector<unsigned> &getRawEdgeCounts() const {
  56. return EdgeCounts;
  57. }
  58. // getEdgeOptimalCounts - This method is used by consumers of optimal edge
  59. // counting information.
  60. //
  61. const std::vector<unsigned> &getRawOptimalEdgeCounts() const {
  62. return OptimalEdgeCounts;
  63. }
  64. };
  65. } // End llvm namespace
  66. #endif