xref: /freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/IPO/StripSymbols.h (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
1*e8d8bef9SDimitry Andric //===- StripSymbols.h - Strip symbols and debug info from a module --------===//
2*e8d8bef9SDimitry Andric //
3*e8d8bef9SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*e8d8bef9SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*e8d8bef9SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*e8d8bef9SDimitry Andric //
7*e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===//
8*e8d8bef9SDimitry Andric //
9*e8d8bef9SDimitry Andric // The StripSymbols transformation implements code stripping. Specifically, it
10*e8d8bef9SDimitry Andric // can delete:
11*e8d8bef9SDimitry Andric //
12*e8d8bef9SDimitry Andric //   * names for virtual registers
13*e8d8bef9SDimitry Andric //   * symbols for internal globals and functions
14*e8d8bef9SDimitry Andric //   * debug information
15*e8d8bef9SDimitry Andric //
16*e8d8bef9SDimitry Andric // Note that this transformation makes code much less readable, so it should
17*e8d8bef9SDimitry Andric // only be used in situations where the 'strip' utility would be used, such as
18*e8d8bef9SDimitry Andric // reducing code size or making it harder to reverse engineer code.
19*e8d8bef9SDimitry Andric //
20*e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===//
21*e8d8bef9SDimitry Andric 
22*e8d8bef9SDimitry Andric #ifndef LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
23*e8d8bef9SDimitry Andric #define LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
24*e8d8bef9SDimitry Andric 
25*e8d8bef9SDimitry Andric #include "llvm/IR/PassManager.h"
26*e8d8bef9SDimitry Andric 
27*e8d8bef9SDimitry Andric namespace llvm {
28*e8d8bef9SDimitry Andric 
29*e8d8bef9SDimitry Andric struct StripSymbolsPass : PassInfoMixin<StripSymbolsPass> {
30*e8d8bef9SDimitry Andric   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
31*e8d8bef9SDimitry Andric };
32*e8d8bef9SDimitry Andric 
33*e8d8bef9SDimitry Andric struct StripNonDebugSymbolsPass : PassInfoMixin<StripNonDebugSymbolsPass> {
34*e8d8bef9SDimitry Andric   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
35*e8d8bef9SDimitry Andric };
36*e8d8bef9SDimitry Andric 
37*e8d8bef9SDimitry Andric struct StripDebugDeclarePass : PassInfoMixin<StripDebugDeclarePass> {
38*e8d8bef9SDimitry Andric   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
39*e8d8bef9SDimitry Andric };
40*e8d8bef9SDimitry Andric 
41*e8d8bef9SDimitry Andric struct StripDeadDebugInfoPass : PassInfoMixin<StripDeadDebugInfoPass> {
42*e8d8bef9SDimitry Andric   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
43*e8d8bef9SDimitry Andric };
44*e8d8bef9SDimitry Andric 
45*e8d8bef9SDimitry Andric } // end namespace llvm
46*e8d8bef9SDimitry Andric 
47*e8d8bef9SDimitry Andric #endif // LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
48