LLVM
8.0.1
|
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.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/IPO.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, SmallPtrSetImpl< const GlobalValue *> &UsedValues) |
Find values that are marked as llvm.used. More... | |
static bool | StripSymbolNames (Module &M, bool PreserveDbgInfo) |
StripSymbolNames - Strip symbol names. More... | |
|
static |
Find values that are marked as llvm.used.
Definition at line 191 of file StripSymbols.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::Value::stripPointerCasts().
Referenced by StripSymbolNames().
Definition at line 100 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripNonDebugSymbols | , |
"strip-nondebug" | , | ||
"Strip all | symbols, | ||
except dbg | symbols, | ||
from a module" | , | ||
false | , | ||
false | |||
) |
Definition at line 108 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripDebugDeclare | , |
"strip-debug-declare" | , | ||
"Strip all llvm.dbg.declare intrinsics" | , | ||
false | , | ||
false | |||
) |
Definition at line 117 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripDeadDebugInfo | , |
"strip-dead-debug-info" | , | ||
"Strip debug info for unused symbols" | , | ||
false | , | ||
false | |||
) |
Definition at line 125 of file StripSymbols.cpp.
OnlyUsedBy - Return true if V is only used by Usr.
Definition at line 133 of file StripSymbols.cpp.
References llvm::Value::users().
Referenced by RemoveDeadConstant().
|
static |
Definition at line 141 of file StripSymbols.cpp.
References assert(), llvm::Constant::destroyConstant(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::RISCVFenceField::O, OnlyUsedBy(), llvm::User::operands(), and llvm::Value::use_empty().
Referenced by StripSymbolNames().
StripSymbolNames - Strip symbol names.
Definition at line 205 of file StripSymbols.cpp.
References llvm::NamedMDNode::addOperand(), assert(), C, llvm::SmallVectorImpl< T >::clear(), llvm::NamedMDNode::clearOperands(), llvm::DebugInfoFinder::compile_units(), llvm::SmallPtrSetImpl< PtrType >::count(), E, llvm::SmallVectorBase::empty(), llvm::Instruction::eraseFromParent(), llvm::Function::eraseFromParent(), F(), findUsedValues(), llvm::MDTuple::get(), llvm::CallBase::getArgOperand(), llvm::Module::getContext(), llvm::Module::getFunction(), llvm::Module::getGlobalVariable(), llvm::Module::getOrInsertNamedMetadata(), llvm::Module::global_begin(), llvm::Module::global_end(), llvm::Module::globals(), I, llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::SmallVectorImpl< T >::insert(), llvm::DebugInfoFinder::processModule(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::iplist_impl< IntrusiveListT, TraitsT >::push_back(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemoveDeadConstant(), llvm::StripDebugInfo(), StripSymtab(), StripTypeNames(), llvm::DebugInfoFinder::subprograms(), llvm::Value::use_empty(), and llvm::Value::user_back().
|
static |
Definition at line 162 of file StripSymbols.cpp.
References llvm::ValueSymbolTable::begin(), llvm::ValueSymbolTable::end(), llvm::Value::getName(), llvm::Value::setName(), llvm::StringRef::startswith(), and VI.
Referenced by StripSymbolNames().
Definition at line 175 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().