add a pass that can extract all kinds of global values, not just functions. Update llvm-extract to use it and optionally extract a global variable if you want it too

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48015 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Lenharth
2008-03-07 19:51:57 +00:00
parent bbf1c514bd
commit d245a8ae47
3 changed files with 206 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ class ModulePass;
class Pass;
class Function;
class BasicBlock;
class GlobalValue;
//===----------------------------------------------------------------------===//
//
@@ -85,6 +86,14 @@ ModulePass *createGlobalDCEPass();
ModulePass *createFunctionExtractionPass(Function *F, bool deleteFn = false,
bool relinkCallees = false);
//===----------------------------------------------------------------------===//
/// createGVExtractionPass - If deleteFn is true, this pass deletes as
/// the specified global values. Otherwise, it deletes as much of the module as
/// possible, except for the global values specified.
///
ModulePass *createGVExtractionPass(std::vector<GlobalValue*>& GVs, bool
deleteFn = false,
bool relinkCallees = false);
//===----------------------------------------------------------------------===//
/// createFunctionInliningPass - Return a new pass object that uses a heuristic