LLVM API Documentation
#include "llvm/Transforms/IPO.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/DebugInfo.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/TypeFinder.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils/Local.h"
Go to the source code of this file.
Functions | |
INITIALIZE_PASS (StripSymbols,"strip","Strip all symbols from a module", false, false) ModulePass *llvm | |
INITIALIZE_PASS (StripNonDebugSymbols,"strip-nondebug","Strip all symbols, except dbg symbols, from a module", false, false) ModulePass *llvm | |
INITIALIZE_PASS (StripDebugDeclare,"strip-debug-declare","Strip all llvm.dbg.declare intrinsics", false, false) ModulePass *llvm | |
INITIALIZE_PASS (StripDeadDebugInfo,"strip-dead-debug-info","Strip debug info for unused symbols", false, false) ModulePass *llvm | |
static bool | OnlyUsedBy (Value *V, Value *Usr) |
OnlyUsedBy - Return true if V is only used by Usr. More... | |
static void | RemoveDeadConstant (Constant *C) |
static void | StripSymtab (ValueSymbolTable &ST, bool PreserveDbgInfo) |
static void | StripTypeNames (Module &M, bool PreserveDbgInfo) |
static void | findUsedValues (GlobalVariable *LLVMUsed, SmallPtrSet< const GlobalValue *, 8 > &UsedValues) |
Find values that are marked as llvm.used. More... | |
static bool | StripSymbolNames (Module &M, bool PreserveDbgInfo) |
StripSymbolNames - Strip symbol names. More... | |
static bool | StripDebugInfo (Module &M) |
|
static |
Find values that are marked as llvm.used.
Definition at line 194 of file StripSymbols.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), and llvm::Value::stripPointerCasts().
Referenced by StripSymbolNames().
Definition at line 101 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripNonDebugSymbols | , |
"strip-nondebug" | , | ||
"Strip all | symbols, | ||
except dbg | symbols, | ||
from a module" | , | ||
false | , | ||
false | |||
) |
Definition at line 109 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripDebugDeclare | , |
"strip-debug-declare" | , | ||
"Strip all llvm.dbg.declare intrinsics" | , | ||
false | , | ||
false | |||
) |
Definition at line 118 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripDeadDebugInfo | , |
"strip-dead-debug-info" | , | ||
"Strip debug info for unused symbols" | , | ||
false | , | ||
false | |||
) |
Definition at line 126 of file StripSymbols.cpp.
OnlyUsedBy - Return true if V is only used by Usr.
Definition at line 134 of file StripSymbols.cpp.
References I, llvm::Value::use_begin(), and llvm::Value::use_end().
Referenced by RemoveDeadConstant().
|
static |
Definition at line 143 of file StripSymbols.cpp.
References llvm::CallingConv::C, llvm::Constant::destroyConstant(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Value::getType(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), OnlyUsedBy(), and llvm::Value::use_empty().
Definition at line 237 of file StripSymbols.cpp.
References llvm::Module::begin(), llvm::Module::end(), llvm::Instruction::eraseFromParent(), llvm::NamedMDNode::eraseFromParent(), llvm::Module::getFunction(), llvm::NamedMDNode::getName(), llvm::A64CC::MI, llvm::Module::named_metadata_begin(), llvm::Module::named_metadata_end(), and llvm::StringRef::startswith().
StripSymbolNames - Strip symbol names.
Definition at line 208 of file StripSymbols.cpp.
References llvm::Module::begin(), llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::Module::end(), findUsedValues(), llvm::Module::getGlobalVariable(), llvm::Module::global_begin(), llvm::Module::global_end(), I, StripSymtab(), and StripTypeNames().
|
static |
Definition at line 165 of file StripSymbols.cpp.
References llvm::ValueSymbolTable::begin(), llvm::ValueSymbolTable::end(), llvm::Value::getName(), llvm::Value::setName(), and llvm::StringRef::startswith().
Referenced by StripSymbolNames().
Definition at line 178 of file StripSymbols.cpp.
References llvm::StringRef::empty(), llvm::StructType::getName(), llvm::StructType::isLiteral(), llvm::TypeFinder::run(), llvm::StructType::setName(), llvm::TypeFinder::size(), and llvm::StringRef::startswith().
Referenced by StripSymbolNames().