IPO.h revision 430aa9ec1c462886be420f000d62ddd93fc45250
1//===- llvm/Transforms/CleanupGCCOutput.h - Cleanup GCC Output ---*- C++ -*--=//
2//
3//
4//===----------------------------------------------------------------------===//
5
6#ifndef LLVM_TRANSFORMS_CLEANUPGCCOUTPUT_H
7#define LLVM_TRANSFORMS_CLEANUPGCCOUTPUT_H
8
9#include "llvm/Analysis/FindUsedTypes.h"
10
11class CleanupGCCOutput : public Pass {
12  Method *Malloc, *Free;  // Pointers to external declarations, or null if none
13  FindUsedTypes FUT;      // Use FUT to eliminate type names that are never used
14public:
15
16  inline CleanupGCCOutput() : Malloc(0), Free(0) {}
17
18  // PatchUpMethodReferences - This is a part of the functionality exported by
19  // the CleanupGCCOutput pass.  This causes functions with different signatures
20  // to be linked together if they have the same name.
21  //
22  static bool PatchUpMethodReferences(Module *M);
23
24  // doPassInitialization - For this pass, it removes global symbol table
25  // entries for primitive types.  These are never used for linking in GCC and
26  // they make the output uglier to look at, so we nuke them.
27  //
28  // Also, initialize instance variables.
29  //
30  bool doPassInitialization(Module *M);
31
32  // doPerMethodWork - This method simplifies the specified method hopefully.
33  //
34  bool doPerMethodWork(Method *M);
35
36  // doPassFinalization - Strip out type names that are unused by the program
37  bool doPassFinalization(Module *M);
38private:
39  bool doOneCleanupPass(Method *M);
40};
41
42#endif
43