LLVM API Documentation
#include "llvm/Transforms/IPO.h"#include "llvm/Constants.h"#include "llvm/DerivedTypes.h"#include "llvm/Instructions.h"#include "llvm/LLVMContext.h"#include "llvm/Module.h"#include "llvm/Pass.h"#include "llvm/Analysis/DebugInfo.h"#include "llvm/ValueSymbolTable.h"#include "llvm/TypeSymbolTable.h"#include "llvm/Transforms/Utils/Local.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 () |
| ModulePass * | llvm::createStripDebugDeclarePass () |
| 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) |
| static void | findUsedValues (GlobalVariable *LLVMUsed, SmallPtrSet< const GlobalValue *, 8 > &UsedValues) |
| Find values that are marked as llvm.used. | |
| static bool | StripSymbolNames (Module &M, bool PreserveDbgInfo) |
| StripSymbolNames - Strip symbol names. | |
| static 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") |
| static RegisterPass < StripDebugDeclare > | Z ("strip-debug-declare","Strip all llvm.dbg.declare intrinsics") |
| static void findUsedValues | ( | GlobalVariable * | LLVMUsed, | |
| SmallPtrSet< const GlobalValue *, 8 > & | UsedValues | |||
| ) | [static] |
Find values that are marked as llvm.used.
Definition at line 160 of file StripSymbols.cpp.
References llvm::dyn_cast(), llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), GV, llvm::SmallPtrSet< PtrType, SmallSize >::insert(), and llvm::Value::stripPointerCasts().
Referenced by StripDebugInfo(), and StripSymbolNames().
OnlyUsedBy - Return true if V is only used by Usr.
Definition at line 105 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 114 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().
Definition at line 204 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::UndefValue::get(), llvm::Module::getFunction(), llvm::Module::getGlobalVariable(), llvm::Value::getName(), llvm::Module::getNamedGlobal(), llvm::User::getOperand(), llvm::GlobalValue::getSection(), llvm::GlobalValue::getType(), llvm::Module::getTypeSymbolTable(), llvm::Module::global_begin(), llvm::Module::global_end(), GV, llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalValue::hasSection(), llvm::GlobalValue::InternalLinkage, llvm::RecursivelyDeleteTriviallyDeadInstructions(), llvm::TypeSymbolTable::remove(), RemoveDeadConstant(), llvm::Value::replaceAllUsesWith(), llvm::GlobalValue::setLinkage(), llvm::StringRef::startswith(), llvm::Value::use_back(), and llvm::Value::use_empty().
StripSymbolNames - Strip symbol names.
Definition at line 175 of file StripSymbols.cpp.
References llvm::Module::begin(), llvm::SmallPtrSet< PtrType, SmallSize >::count(), E, llvm::Module::end(), findUsedValues(), llvm::Module::getGlobalVariable(), 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 137 of file StripSymbols.cpp.
References llvm::ValueSymbolTable::begin(), llvm::ValueSymbolTable::end(), llvm::Value::getName(), llvm::Value::setName(), llvm::StringRef::startswith(), V, and VE.
Referenced by StripSymbolNames().
| static void StripTypeSymtab | ( | TypeSymbolTable & | ST, | |
| bool | PreserveDbgInfo | |||
| ) | [static] |
Definition at line 150 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 42 of file StripSymbols.cpp.
Definition at line 40 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] |
RegisterPass<StripDebugDeclare> Z("strip-debug-declare","Strip all llvm.dbg.declare intrinsics") [static] |