aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/Scalar/SymbolStripping.h
blob: 83724eb739443dbc084d8b3bfd47a9ab1735f4d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//===-- SymbolStripping.h - Functions that Strip Symbol Tables ---*- C++ -*--=//
//
// This family of functions removes symbols from the symbol tables of methods
// and classes.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_OPT_SYMBOL_STRIPPING_H
#define LLVM_OPT_SYMBOL_STRIPPING_H

class Method;
class Module;
#include "llvm/Transforms/Pass.h"

namespace opt {

struct SymbolStripping : public StatelessPass<SymbolStripping> {
  // doSymbolStripping - Remove all symbolic information from a method
  //
  static bool doSymbolStripping(Method *M);

  inline static bool doPerMethodWork(Method *M) {
    return doSymbolStripping(M);
  }
};

struct FullSymbolStripping : public StatelessPass<FullSymbolStripping> {
  
  // doStripGlobalSymbols - Remove all symbolic information from all methods 
  // in a module, and all module level symbols. (method names, etc...)
  //
  static bool doStripGlobalSymbols(Module *M);

  inline static bool doPassInitialization(Module *M) {
    return doStripGlobalSymbols(M);
  }

  inline static bool doPerMethodWork(Method *M) {
    return SymbolStripping::doSymbolStripping(M);
  }
};

} // End namespace opt 
#endif