LLVM 19.0.0git
Functions | Variables
StripSymbols.cpp File Reference
#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/InstIterator.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/Support/CommandLine.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Utils/Local.h"

Go to the source code of this file.

Functions

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 StripTypeNames (Module &M, bool PreserveDbgInfo)
 
static void findUsedValues (GlobalVariable *LLVMUsed, SmallPtrSetImpl< const GlobalValue * > &UsedValues)
 Find values that are marked as llvm.used.
 
static bool StripSymbolNames (Module &M, bool PreserveDbgInfo)
 StripSymbolNames - Strip symbol names.
 
static bool stripDebugDeclareImpl (Module &M)
 
static bool stripDeadDebugInfoImpl (Module &M)
 

Variables

static cl::opt< boolStripGlobalConstants ("strip-global-constants", cl::init(false), cl::Hidden, cl::desc("Removes debug compile units which reference " "to non-existing global constants"))
 

Function Documentation

◆ findUsedValues()

static void findUsedValues ( GlobalVariable LLVMUsed,
SmallPtrSetImpl< const GlobalValue * > &  UsedValues 
)
static

◆ OnlyUsedBy()

static bool OnlyUsedBy ( Value V,
Value Usr 
)
static

OnlyUsedBy - Return true if V is only used by Usr.

Definition at line 46 of file StripSymbols.cpp.

Referenced by RemoveDeadConstant().

◆ RemoveDeadConstant()

static void RemoveDeadConstant ( Constant C)
static

◆ stripDeadDebugInfoImpl()

static bool stripDeadDebugInfoImpl ( Module M)
static

◆ stripDebugDeclareImpl()

static bool stripDebugDeclareImpl ( Module M)
static

◆ StripSymbolNames()

static bool StripSymbolNames ( Module M,
bool  PreserveDbgInfo 
)
static

StripSymbolNames - Strip symbol names.

Definition at line 119 of file StripSymbols.cpp.

References llvm::SmallPtrSetImpl< PtrType >::contains(), findUsedValues(), I, StripSymtab(), and StripTypeNames().

Referenced by llvm::StripSymbolsPass::run(), and llvm::StripNonDebugSymbolsPass::run().

◆ StripSymtab()

static void StripSymtab ( ValueSymbolTable ST,
bool  PreserveDbgInfo 
)
static

Definition at line 77 of file StripSymbols.cpp.

Referenced by StripSymbolNames().

◆ StripTypeNames()

static void StripTypeNames ( Module M,
bool  PreserveDbgInfo 
)
static

Definition at line 90 of file StripSymbols.cpp.

References llvm::TypeFinder::run().

Referenced by StripSymbolNames().

Variable Documentation

◆ StripGlobalConstants

cl::opt< bool > StripGlobalConstants("strip-global-constants", cl::init(false), cl::Hidden, cl::desc("Removes debug compile units which reference " "to non-existing global constants")) ( "strip-global-constants"  ,
cl::init(false)  ,
cl::Hidden  ,
cl::desc("Removes debug compile units which reference " "to non-existing global constants")   
)
static

Referenced by stripDeadDebugInfoImpl().