StripSymbols.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- StripSymbols.h - Strip symbols and debug info from a module --------===//
  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. // The StripSymbols transformation implements code stripping. Specifically, it
  15. // can delete:
  16. //
  17. // * names for virtual registers
  18. // * symbols for internal globals and functions
  19. // * debug information
  20. //
  21. // Note that this transformation makes code much less readable, so it should
  22. // only be used in situations where the 'strip' utility would be used, such as
  23. // reducing code size or making it harder to reverse engineer code.
  24. //
  25. //===----------------------------------------------------------------------===//
  26. #ifndef LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
  27. #define LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
  28. #include "llvm/IR/PassManager.h"
  29. namespace llvm {
  30. struct StripSymbolsPass : PassInfoMixin<StripSymbolsPass> {
  31. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  32. };
  33. struct StripNonDebugSymbolsPass : PassInfoMixin<StripNonDebugSymbolsPass> {
  34. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  35. };
  36. struct StripDebugDeclarePass : PassInfoMixin<StripDebugDeclarePass> {
  37. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  38. };
  39. struct StripDeadDebugInfoPass : PassInfoMixin<StripDeadDebugInfoPass> {
  40. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  41. };
  42. } // end namespace llvm
  43. #endif // LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
  44. #ifdef __GNUC__
  45. #pragma GCC diagnostic pop
  46. #endif