#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/IPO/StripSymbols.h"
#include "llvm/Transforms/Utils/Local.h"
usingnamespacellvm;
static 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"));
static bool OnlyUsedBy(Value *V, Value *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) { … }
static bool StripSymbolNames(Module &M, bool PreserveDbgInfo) { … }
static bool stripDebugDeclareImpl(Module &M) { … }
static bool stripDeadDebugInfoImpl(Module &M) { … }
PreservedAnalyses StripSymbolsPass::run(Module &M, ModuleAnalysisManager &AM) { … }
PreservedAnalyses StripNonDebugSymbolsPass::run(Module &M,
ModuleAnalysisManager &AM) { … }
PreservedAnalyses StripDebugDeclarePass::run(Module &M,
ModuleAnalysisManager &AM) { … }
PreservedAnalyses StripDeadDebugInfoPass::run(Module &M,
ModuleAnalysisManager &AM) { … }