LLVM API Documentation
#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"
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") |
| 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().
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] |
Definition at line 90 of file StripSymbols.cpp.
References llvm::Constant::destroyConstant(), llvm::GlobalValue::eraseFromParent(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), llvm::Value::getType(), GV, llvm::GlobalValue::hasLocalLinkage(), OnlyUsedBy(), and llvm::Value::use_empty().
Referenced by StripDebugInfo().
| bool StripDebugInfo | ( | Module & | M | ) |
Definition at line 186 of file StripSymbols.cpp.
References Arg, llvm::TypeSymbolTable::begin(), llvm::CallingConv::C, llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::dyn_cast(), E, llvm::TypeSymbolTable::end(), llvm::Function::eraseFromParent(), llvm::Instruction::eraseFromParent(), findUsedValues(), llvm::Module::getFunction(), llvm::Module::getNamedGlobal(), llvm::User::getOperand(), llvm::GlobalValue::getSection(), llvm::Module::getTypeSymbolTable(), llvm::Module::global_begin(), llvm::Module::global_end(), GV, llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalValue::hasSection(), llvm::GlobalValue::InternalLinkage, llvm::TypeSymbolTable::remove(), RemoveDeadConstant(), llvm::GlobalValue::setLinkage(), llvm::Value::use_back(), and llvm::Value::use_empty().
| bool StripSymbolNames | ( | Module & | M, | |
| bool | PreserveDbgInfo | |||
| ) |
StripSymbolNames - Strip symbol names.
Definition at line 158 of file StripSymbols.cpp.
References llvm::Module::begin(), llvm::SmallPtrSet< PtrType, SmallSize >::count(), E, llvm::Module::end(), findUsedValues(), llvm::Module::getTypeSymbolTable(), llvm::Module::global_begin(), llvm::Module::global_end(), StripSymtab(), and StripTypeSymtab().
| static void StripSymtab | ( | ValueSymbolTable & | ST, | |
| bool | PreserveDbgInfo | |||
| ) | [static] |
Definition at line 113 of file StripSymbols.cpp.
References llvm::ValueSymbolTable::begin(), llvm::ValueSymbolTable::end(), llvm::Value::getNameStart(), llvm::Value::setName(), V, and VE.
Referenced by StripSymbolNames().
| static void StripTypeSymtab | ( | TypeSymbolTable & | ST, | |
| bool | PreserveDbgInfo | |||
| ) | [static] |
Definition at line 126 of file StripSymbols.cpp.
References llvm::TypeSymbolTable::begin(), E, llvm::TypeSymbolTable::end(), and llvm::TypeSymbolTable::remove().
Referenced by StripSymbolNames().
char ID [static] |
Definition at line 39 of file StripSymbols.cpp.
| bool OnlyDebugInfo |
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] |