LLVM
15.0.0git
|
#include "llvm/Transforms/IPO/StripSymbols.h"
#include "llvm/ADT/SmallPtrSet.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/PassManager.h"
#include "llvm/IR/TypeFinder.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/IPO.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, 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 bool | stripDebugDeclareImpl (Module &M) |
static bool | stripDeadDebugInfoImpl (Module &M) |
|
static |
Find values that are marked as llvm.used.
Definition at line 196 of file StripSymbols.cpp.
References llvm::numbers::e, llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::User::getOperand(), i, llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::Value::stripPointerCasts().
Referenced by StripSymbolNames().
INITIALIZE_PASS | ( | StripDeadDebugInfo | , |
"strip-dead-debug-info" | , | ||
"Strip debug info for unused symbols" | , | ||
false | , | ||
false | |||
) |
Definition at line 128 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripDebugDeclare | , |
"strip-debug-declare" | , | ||
"Strip all llvm.dbg.declare intrinsics" | , | ||
false | , | ||
false | |||
) |
Definition at line 120 of file StripSymbols.cpp.
INITIALIZE_PASS | ( | StripNonDebugSymbols | , |
"strip-nondebug" | , | ||
"Strip all | symbols, | ||
except dbg | symbols, | ||
from a module" | , | ||
false | , | ||
false | |||
) |
Definition at line 111 of file StripSymbols.cpp.
Definition at line 103 of file StripSymbols.cpp.
OnlyUsedBy - Return true if V is only used by Usr.
Definition at line 136 of file StripSymbols.cpp.
References llvm::Value::users().
Referenced by RemoveDeadConstant().
|
static |
Definition at line 144 of file StripSymbols.cpp.
References assert(), llvm::RISCVFenceField::O, OnlyUsedBy(), and Operands.
Referenced by stripDebugDeclareImpl().
|
static |
Definition at line 298 of file StripSymbols.cpp.
References llvm::NamedMDNode::addOperand(), llvm::SmallVectorImpl< T >::clear(), llvm::NamedMDNode::clearOperands(), F, llvm::MDTuple::get(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert(), llvm::SmallVectorImpl< T >::insert(), and M.
Referenced by llvm::StripDeadDebugInfoPass::run().
|
static |
Definition at line 254 of file StripSymbols.cpp.
References assert(), llvm::Instruction::eraseFromParent(), llvm::Function::eraseFromParent(), llvm::CallBase::getArgOperand(), M, llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemoveDeadConstant(), llvm::Value::use_empty(), and llvm::Value::user_back().
Referenced by llvm::StripDebugDeclarePass::run().
|
static |
StripSymbolNames - Strip symbol names.
Definition at line 210 of file StripSymbols.cpp.
References llvm::SmallPtrSetImpl< PtrType >::contains(), findUsedValues(), I, M, StripSymtab(), and StripTypeNames().
Referenced by llvm::StripSymbolsPass::run(), and llvm::StripNonDebugSymbolsPass::run().
|
static |
Definition at line 167 of file StripSymbols.cpp.
References llvm::Value::getName(), llvm::Value::setName(), llvm::ARM_MB::ST, llvm::StringRef::startswith(), and VI.
Referenced by StripSymbolNames().
|
static |
Definition at line 180 of file StripSymbols.cpp.
References llvm::numbers::e, llvm::StringRef::empty(), llvm::StructType::getName(), i, llvm::StructType::isLiteral(), M, llvm::TypeFinder::run(), llvm::StructType::setName(), llvm::TypeFinder::size(), and llvm::StringRef::startswith().
Referenced by StripSymbolNames().