CallPrinter.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- CallPrinter.h - Call graph printer external interface ----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines external functions that can be called to explicitly
  15. // instantiate the call graph printer.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_ANALYSIS_CALLPRINTER_H
  19. #define LLVM_ANALYSIS_CALLPRINTER_H
  20. #include "llvm/IR/PassManager.h"
  21. namespace llvm {
  22. class ModulePass;
  23. /// Pass for printing the call graph to a dot file
  24. class CallGraphDOTPrinterPass : public PassInfoMixin<CallGraphDOTPrinterPass> {
  25. public:
  26. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  27. };
  28. /// Pass for viewing the call graph
  29. class CallGraphViewerPass : public PassInfoMixin<CallGraphViewerPass> {
  30. public:
  31. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  32. };
  33. ModulePass *createCallGraphViewerPass();
  34. ModulePass *createCallGraphDOTPrinterPass();
  35. } // end namespace llvm
  36. #endif
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif