LLVM  8.0.1
Functions
StripSymbols.cpp File Reference
#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"
Include dependency graph for StripSymbols.cpp:

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...
 

Function Documentation

◆ findUsedValues()

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

◆ INITIALIZE_PASS() [1/4]

INITIALIZE_PASS ( StripSymbols  ,
"strip"  ,
"Strip all symbols from a module"  ,
false  ,
false   
)

Definition at line 100 of file StripSymbols.cpp.

◆ INITIALIZE_PASS() [2/4]

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() [3/4]

INITIALIZE_PASS ( StripDebugDeclare  ,
"strip-debug-declare"  ,
"Strip all llvm.dbg.declare intrinsics ,
false  ,
false   
)

Definition at line 117 of file StripSymbols.cpp.

◆ INITIALIZE_PASS() [4/4]

INITIALIZE_PASS ( StripDeadDebugInfo  ,
"strip-dead-debug-info ,
"Strip debug info for unused symbols"  ,
false  ,
false   
)

Definition at line 125 of file StripSymbols.cpp.

◆ OnlyUsedBy()

static bool OnlyUsedBy ( Value V,
Value Usr 
)
static

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().

◆ RemoveDeadConstant()

static void RemoveDeadConstant ( Constant C)
static

◆ StripSymbolNames()

static bool StripSymbolNames ( Module M,
bool  PreserveDbgInfo 
)
static

◆ StripSymtab()

static void StripSymtab ( ValueSymbolTable ST,
bool  PreserveDbgInfo 
)
static

◆ StripTypeNames()

static void StripTypeNames ( Module M,
bool  PreserveDbgInfo 
)
static