LLVM API Documentation

StripSymbols.cpp File Reference

#include "llvm/Transforms/IPO.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/TypeSymbolTable.h"
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SmallPtrSet.h"

Include dependency graph for StripSymbols.cpp:

Go to the source code of this file.

Functions

ModulePass * llvm::createStripSymbolsPass (bool OnlyDebugInfo=false)
ModulePass * llvm::createStripNonDebugSymbolsPass ()
static bool OnlyUsedBy (Value *V, Value *Usr)
 OnlyUsedBy - Return true if V is only used by Usr.
static void RemoveDeadConstant (Constant *C)
static void StripSymtab (ValueSymbolTable &ST, bool PreserveDbgInfo)
static void StripTypeSymtab (TypeSymbolTable &ST, bool PreserveDbgInfo)
void findUsedValues (Module &M, SmallPtrSet< const GlobalValue *, 8 > &llvmUsedValues)
 Find values that are marked as llvm.used.
bool StripSymbolNames (Module &M, bool PreserveDbgInfo)
 StripSymbolNames - Strip symbol names.
bool StripDebugInfo (Module &M)

Variables

static RegisterPass< StripSymbols > X ("strip","Strip all symbols from a module")
static RegisterPass
< StripNonDebugSymbols > 
Y ("strip-nondebug","Strip all symbols, except dbg symbols, from a module")


Function Documentation

void findUsedValues ( Module &  M,
SmallPtrSet< const GlobalValue *, 8 > &  llvmUsedValues 
)

Find values that are marked as llvm.used.

Definition at line 136 of file StripSymbols.cpp.

References BitCast, llvm::Module::getGlobalVariable(), GV, and llvm::SmallPtrSet< PtrType, SmallSize >::insert().

Referenced by StripDebugInfo(), and StripSymbolNames().

static bool OnlyUsedBy ( Value *  V,
Value *  Usr 
) [static]

OnlyUsedBy - Return true if V is only used by Usr.

Definition at line 81 of file StripSymbols.cpp.

References E, llvm::Value::use_begin(), and llvm::Value::use_end().

Referenced by RemoveDeadConstant().

static void RemoveDeadConstant ( Constant *  C  )  [static]

bool StripDebugInfo ( Module &  M  ) 

bool StripSymbolNames ( Module &  M,
bool  PreserveDbgInfo 
)

static void StripSymtab ( ValueSymbolTable &  ST,
bool  PreserveDbgInfo 
) [static]

static void StripTypeSymtab ( TypeSymbolTable &  ST,
bool  PreserveDbgInfo 
) [static]


Variable Documentation

char ID [static]

Definition at line 39 of file StripSymbols.cpp.

Definition at line 37 of file StripSymbols.cpp.

RegisterPass<StripSymbols> X("strip","Strip all symbols from a module") [static]

RegisterPass<StripNonDebugSymbols> Y("strip-nondebug","Strip all symbols, except dbg symbols, from a module") [static]