ff31a4b5323465dacb0e5c421a65f809ca14b084
[oota-llvm.git] / include / llvm / Transforms / Scalar / SymbolStripping.h
1 //===-- SymbolStripping.h - Functions that Strip Symbol Tables ---*- C++ -*--=//
2 //
3 // This family of functions removes symbols from the symbol tables of methods
4 // and classes.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_OPT_SYMBOL_STRIPPING_H
9 #define LLVM_OPT_SYMBOL_STRIPPING_H
10
11 #include "llvm/Pass.h"
12
13 namespace opt {
14
15 struct SymbolStripping : public MethodPass {
16   // doSymbolStripping - Remove all symbolic information from a method
17   //
18   static bool doSymbolStripping(Method *M);
19
20   virtual bool runOnMethod(Method *M) {
21     return doSymbolStripping(M);
22   }
23 };
24
25 struct FullSymbolStripping : public MethodPass {
26   
27   // doStripGlobalSymbols - Remove all symbolic information from all methods 
28   // in a module, and all module level symbols. (method names, etc...)
29   //
30   static bool doStripGlobalSymbols(Module *M);
31
32   virtual bool doInitialization(Module *M) {
33     return doStripGlobalSymbols(M);
34   }
35
36   virtual bool runOnMethod(Method *M) {
37     return SymbolStripping::doSymbolStripping(M);
38   }
39 };
40
41 } // End namespace opt 
42 #endif