LLVM  14.0.0git
StripSymbols.cpp
Go to the documentation of this file.
1 //===- StripSymbols.cpp - Strip symbols and debug info from a module ------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // The StripSymbols transformation implements code stripping. Specifically, it
10 // can delete:
11 //
12 // * names for virtual registers
13 // * symbols for internal globals and functions
14 // * debug information
15 //
16 // Note that this transformation makes code much less readable, so it should
17 // only be used in situations where the 'strip' utility would be used, such as
18 // reducing code size or making it harder to reverse engineer code.
19 //
20 //===----------------------------------------------------------------------===//
21 
23 #include "llvm/ADT/SmallPtrSet.h"
24 #include "llvm/IR/Constants.h"
25 #include "llvm/IR/DebugInfo.h"
26 #include "llvm/IR/DerivedTypes.h"
27 #include "llvm/IR/Instructions.h"
28 #include "llvm/IR/Module.h"
29 #include "llvm/IR/PassManager.h"
30 #include "llvm/IR/TypeFinder.h"
32 #include "llvm/InitializePasses.h"
33 #include "llvm/Pass.h"
34 #include "llvm/Transforms/IPO.h"
36 
37 using namespace llvm;
38 
39 namespace {
40  class StripSymbols : public ModulePass {
41  bool OnlyDebugInfo;
42  public:
43  static char ID; // Pass identification, replacement for typeid
44  explicit StripSymbols(bool ODI = false)
45  : ModulePass(ID), OnlyDebugInfo(ODI) {
47  }
48 
49  bool runOnModule(Module &M) override;
50 
51  void getAnalysisUsage(AnalysisUsage &AU) const override {
52  AU.setPreservesAll();
53  }
54  };
55 
56  class StripNonDebugSymbols : public ModulePass {
57  public:
58  static char ID; // Pass identification, replacement for typeid
59  explicit StripNonDebugSymbols()
60  : ModulePass(ID) {
62  }
63 
64  bool runOnModule(Module &M) override;
65 
66  void getAnalysisUsage(AnalysisUsage &AU) const override {
67  AU.setPreservesAll();
68  }
69  };
70 
71  class StripDebugDeclare : public ModulePass {
72  public:
73  static char ID; // Pass identification, replacement for typeid
74  explicit StripDebugDeclare()
75  : ModulePass(ID) {
77  }
78 
79  bool runOnModule(Module &M) override;
80 
81  void getAnalysisUsage(AnalysisUsage &AU) const override {
82  AU.setPreservesAll();
83  }
84  };
85 
86  class StripDeadDebugInfo : public ModulePass {
87  public:
88  static char ID; // Pass identification, replacement for typeid
89  explicit StripDeadDebugInfo()
90  : ModulePass(ID) {
92  }
93 
94  bool runOnModule(Module &M) override;
95 
96  void getAnalysisUsage(AnalysisUsage &AU) const override {
97  AU.setPreservesAll();
98  }
99  };
100 }
101 
102 char StripSymbols::ID = 0;
103 INITIALIZE_PASS(StripSymbols, "strip",
104  "Strip all symbols from a module", false, false)
105 
106 ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
107  return new StripSymbols(OnlyDebugInfo);
108 }
109 
110 char StripNonDebugSymbols::ID = 0;
111 INITIALIZE_PASS(StripNonDebugSymbols, "strip-nondebug",
112  "Strip all symbols, except dbg symbols, from a module",
113  false, false)
114 
116  return new StripNonDebugSymbols();
117 }
118 
119 char StripDebugDeclare::ID = 0;
120 INITIALIZE_PASS(StripDebugDeclare, "strip-debug-declare",
121  "Strip all llvm.dbg.declare intrinsics", false, false)
122 
124  return new StripDebugDeclare();
125 }
126 
127 char StripDeadDebugInfo::ID = 0;
128 INITIALIZE_PASS(StripDeadDebugInfo, "strip-dead-debug-info",
129  "Strip debug info for unused symbols", false, false)
130 
132  return new StripDeadDebugInfo();
133 }
134 
135 /// OnlyUsedBy - Return true if V is only used by Usr.
136 static bool OnlyUsedBy(Value *V, Value *Usr) {
137  for (User *U : V->users())
138  if (U != Usr)
139  return false;
140 
141  return true;
142 }
143 
145  assert(C->use_empty() && "Constant is not dead!");
147  for (Value *Op : C->operands())
148  if (OnlyUsedBy(Op, C))
149  Operands.insert(cast<Constant>(Op));
150  if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
151  if (!GV->hasLocalLinkage()) return; // Don't delete non-static globals.
152  GV->eraseFromParent();
153  } else if (!isa<Function>(C)) {
154  // FIXME: Why does the type of the constant matter here?
155  if (isa<StructType>(C->getType()) || isa<ArrayType>(C->getType()) ||
156  isa<VectorType>(C->getType()))
157  C->destroyConstant();
158  }
159 
160  // If the constant referenced anything, see if we can delete it as well.
161  for (Constant *O : Operands)
163 }
164 
165 // Strip the symbol table of its names.
166 //
167 static void StripSymtab(ValueSymbolTable &ST, bool PreserveDbgInfo) {
168  for (ValueSymbolTable::iterator VI = ST.begin(), VE = ST.end(); VI != VE; ) {
169  Value *V = VI->getValue();
170  ++VI;
171  if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasLocalLinkage()) {
172  if (!PreserveDbgInfo || !V->getName().startswith("llvm.dbg"))
173  // Set name to "", removing from symbol table!
174  V->setName("");
175  }
176  }
177 }
178 
179 // Strip any named types of their names.
180 static void StripTypeNames(Module &M, bool PreserveDbgInfo) {
181  TypeFinder StructTypes;
182  StructTypes.run(M, false);
183 
184  for (unsigned i = 0, e = StructTypes.size(); i != e; ++i) {
185  StructType *STy = StructTypes[i];
186  if (STy->isLiteral() || STy->getName().empty()) continue;
187 
188  if (PreserveDbgInfo && STy->getName().startswith("llvm.dbg"))
189  continue;
190 
191  STy->setName("");
192  }
193 }
194 
195 /// Find values that are marked as llvm.used.
196 static void findUsedValues(GlobalVariable *LLVMUsed,
198  if (!LLVMUsed) return;
199  UsedValues.insert(LLVMUsed);
200 
201  ConstantArray *Inits = cast<ConstantArray>(LLVMUsed->getInitializer());
202 
203  for (unsigned i = 0, e = Inits->getNumOperands(); i != e; ++i)
204  if (GlobalValue *GV =
205  dyn_cast<GlobalValue>(Inits->getOperand(i)->stripPointerCasts()))
206  UsedValues.insert(GV);
207 }
208 
209 /// StripSymbolNames - Strip symbol names.
210 static bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
211 
212  SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
213  findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
214  findUsedValues(M.getGlobalVariable("llvm.compiler.used"), llvmUsedValues);
215 
216  for (GlobalVariable &GV : M.globals()) {
217  if (GV.hasLocalLinkage() && llvmUsedValues.count(&GV) == 0)
218  if (!PreserveDbgInfo || !GV.getName().startswith("llvm.dbg"))
219  GV.setName(""); // Internal symbols can't participate in linkage
220  }
221 
222  for (Function &I : M) {
223  if (I.hasLocalLinkage() && llvmUsedValues.count(&I) == 0)
224  if (!PreserveDbgInfo || !I.getName().startswith("llvm.dbg"))
225  I.setName(""); // Internal symbols can't participate in linkage
226  if (auto *Symtab = I.getValueSymbolTable())
227  StripSymtab(*Symtab, PreserveDbgInfo);
228  }
229 
230  // Remove all names from types.
231  StripTypeNames(M, PreserveDbgInfo);
232 
233  return true;
234 }
235 
236 bool StripSymbols::runOnModule(Module &M) {
237  if (skipModule(M))
238  return false;
239 
240  bool Changed = false;
241  Changed |= StripDebugInfo(M);
242  if (!OnlyDebugInfo)
243  Changed |= StripSymbolNames(M, false);
244  return Changed;
245 }
246 
247 bool StripNonDebugSymbols::runOnModule(Module &M) {
248  if (skipModule(M))
249  return false;
250 
251  return StripSymbolNames(M, true);
252 }
253 
254 static bool stripDebugDeclareImpl(Module &M) {
255 
256  Function *Declare = M.getFunction("llvm.dbg.declare");
257  std::vector<Constant*> DeadConstants;
258 
259  if (Declare) {
260  while (!Declare->use_empty()) {
261  CallInst *CI = cast<CallInst>(Declare->user_back());
262  Value *Arg1 = CI->getArgOperand(0);
263  Value *Arg2 = CI->getArgOperand(1);
264  assert(CI->use_empty() && "llvm.dbg intrinsic should have void result");
265  CI->eraseFromParent();
266  if (Arg1->use_empty()) {
267  if (Constant *C = dyn_cast<Constant>(Arg1))
268  DeadConstants.push_back(C);
269  else
271  }
272  if (Arg2->use_empty())
273  if (Constant *C = dyn_cast<Constant>(Arg2))
274  DeadConstants.push_back(C);
275  }
276  Declare->eraseFromParent();
277  }
278 
279  while (!DeadConstants.empty()) {
280  Constant *C = DeadConstants.back();
281  DeadConstants.pop_back();
282  if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
283  if (GV->hasLocalLinkage())
284  RemoveDeadConstant(GV);
285  } else
287  }
288 
289  return true;
290 }
291 
292 bool StripDebugDeclare::runOnModule(Module &M) {
293  if (skipModule(M))
294  return false;
295  return stripDebugDeclareImpl(M);
296 }
297 
299  bool Changed = false;
300 
301  LLVMContext &C = M.getContext();
302 
303  // Find all debug info in F. This is actually overkill in terms of what we
304  // want to do, but we want to try and be as resilient as possible in the face
305  // of potential debug info changes by using the formal interfaces given to us
306  // as much as possible.
308  F.processModule(M);
309 
310  // For each compile unit, find the live set of global variables/functions and
311  // replace the current list of potentially dead global variables/functions
312  // with the live list.
313  SmallVector<Metadata *, 64> LiveGlobalVariables;
315 
316  std::set<DIGlobalVariableExpression *> LiveGVs;
317  for (GlobalVariable &GV : M.globals()) {
319  GV.getDebugInfo(GVEs);
320  for (auto *GVE : GVEs)
321  LiveGVs.insert(GVE);
322  }
323 
324  std::set<DICompileUnit *> LiveCUs;
325  // Any CU referenced from a subprogram is live.
326  for (DISubprogram *SP : F.subprograms()) {
327  if (SP->getUnit())
328  LiveCUs.insert(SP->getUnit());
329  }
330 
331  bool HasDeadCUs = false;
332  for (DICompileUnit *DIC : F.compile_units()) {
333  // Create our live global variable list.
334  bool GlobalVariableChange = false;
335  for (auto *DIG : DIC->getGlobalVariables()) {
336  if (DIG->getExpression() && DIG->getExpression()->isConstant())
337  LiveGVs.insert(DIG);
338 
339  // Make sure we only visit each global variable only once.
340  if (!VisitedSet.insert(DIG).second)
341  continue;
342 
343  // If a global variable references DIG, the global variable is live.
344  if (LiveGVs.count(DIG))
345  LiveGlobalVariables.push_back(DIG);
346  else
347  GlobalVariableChange = true;
348  }
349 
350  if (!LiveGlobalVariables.empty())
351  LiveCUs.insert(DIC);
352  else if (!LiveCUs.count(DIC))
353  HasDeadCUs = true;
354 
355  // If we found dead global variables, replace the current global
356  // variable list with our new live global variable list.
357  if (GlobalVariableChange) {
358  DIC->replaceGlobalVariables(MDTuple::get(C, LiveGlobalVariables));
359  Changed = true;
360  }
361 
362  // Reset lists for the next iteration.
363  LiveGlobalVariables.clear();
364  }
365 
366  if (HasDeadCUs) {
367  // Delete the old node and replace it with a new one
368  NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
369  NMD->clearOperands();
370  if (!LiveCUs.empty()) {
371  for (DICompileUnit *CU : LiveCUs)
372  NMD->addOperand(CU);
373  }
374  Changed = true;
375  }
376 
377  return Changed;
378 }
379 
380 /// Remove any debug info for global variables/functions in the given module for
381 /// which said global variable/function no longer exists (i.e. is null).
382 ///
383 /// Debugging information is encoded in llvm IR using metadata. This is designed
384 /// such a way that debug info for symbols preserved even if symbols are
385 /// optimized away by the optimizer. This special pass removes debug info for
386 /// such symbols.
387 bool StripDeadDebugInfo::runOnModule(Module &M) {
388  if (skipModule(M))
389  return false;
390  return stripDeadDebugInfoImpl(M);
391 }
392 
394  StripDebugInfo(M);
395  StripSymbolNames(M, false);
396  return PreservedAnalyses::all();
397 }
398 
400  ModuleAnalysisManager &AM) {
401  StripSymbolNames(M, true);
402  return PreservedAnalyses::all();
403 }
404 
406  ModuleAnalysisManager &AM) {
408  return PreservedAnalyses::all();
409 }
410 
412  ModuleAnalysisManager &AM) {
414  return PreservedAnalyses::all();
415 }
i
i
Definition: README.txt:29
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm::RecursivelyDeleteTriviallyDeadInstructions
bool RecursivelyDeleteTriviallyDeadInstructions(Value *V, const TargetLibraryInfo *TLI=nullptr, MemorySSAUpdater *MSSAU=nullptr, std::function< void(Value *)> AboutToDeleteCallback=std::function< void(Value *)>())
If the specified value is a trivially dead instruction, delete it.
Definition: Local.cpp:511
llvm::StringRef::startswith
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:286
llvm::StripDebugInfo
bool StripDebugInfo(Module &M)
Strip debug info in the module if it exists.
Definition: DebugInfo.cpp:476
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
StripSymbols.h
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::StringRef::empty
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:153
llvm::NamedMDNode
A tuple of MDNodes.
Definition: Metadata.h:1391
llvm::StripDeadDebugInfoPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: StripSymbols.cpp:411
llvm::StructType::getName
StringRef getName() const
Return the name for this struct type if it has an identity.
Definition: Type.cpp:545
llvm::TypeFinder::size
size_t size() const
Definition: TypeFinder.h:56
llvm::ModulePass
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:238
stripDeadDebugInfoImpl
static bool stripDeadDebugInfoImpl(Module &M)
Definition: StripSymbols.cpp:298
llvm::Function
Definition: Function.h:61
Pass.h
llvm::Function::eraseFromParent
void eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Definition: Function.cpp:365
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::StripSymbolsPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: StripSymbols.cpp:393
llvm::GlobalVariable
Definition: GlobalVariable.h:40
Local.h
Module.h
llvm::initializeStripDeadDebugInfoPass
void initializeStripDeadDebugInfoPass(PassRegistry &)
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert
std::pair< iterator, bool > insert(const ValueT &V)
Definition: DenseSet.h:206
llvm::DebugInfoFinder
Utility to find all debug info in a module.
Definition: DebugInfo.h:90
llvm::createStripDebugDeclarePass
ModulePass * createStripDebugDeclarePass()
llvm::StructType::setName
void setName(StringRef Name)
Change the name of this type to the specified name, or to a name with a suffix if there is a collisio...
Definition: Type.cpp:426
F
#define F(x, y, z)
Definition: MD5.cpp:56
OnlyUsedBy
static bool OnlyUsedBy(Value *V, Value *Usr)
OnlyUsedBy - Return true if V is only used by Usr.
Definition: StripSymbols.cpp:136
RemoveDeadConstant
static void RemoveDeadConstant(Constant *C)
Definition: StripSymbols.cpp:144
llvm::NamedMDNode::addOperand
void addOperand(MDNode *M)
Definition: Metadata.cpp:1130
llvm::initializeStripDebugDeclarePass
void initializeStripDebugDeclarePass(PassRegistry &)
llvm::PassRegistry::getPassRegistry
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition: PassRegistry.cpp:31
Constants.h
llvm::User
Definition: User.h:44
findUsedValues
static void findUsedValues(GlobalVariable *LLVMUsed, SmallPtrSetImpl< const GlobalValue * > &UsedValues)
Find values that are marked as llvm.used.
Definition: StripSymbols.cpp:196
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
TypeFinder.h
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
llvm::ConstantArray
ConstantArray - Constant Array Declarations.
Definition: Constants.h:409
llvm::Value::setName
void setName(const Twine &Name)
Change the name of the value.
Definition: Value.cpp:364
SmallPtrSet.h
llvm::Value::use_empty
bool use_empty() const
Definition: Value.h:345
ValueSymbolTable.h
Operands
mir Rename Register Operands
Definition: MIRNamerPass.cpp:78
llvm::Value::user_back
User * user_back()
Definition: Value.h:408
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition: DenseSet.h:268
llvm::StripNonDebugSymbolsPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: StripSymbols.cpp:399
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:192
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::GlobalVariable::getInitializer
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
Definition: GlobalVariable.h:136
VI
@ VI
Definition: SIInstrInfo.cpp:7679
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::StringMapIterator
Definition: StringMap.h:25
llvm::Instruction::eraseFromParent
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
Definition: Instruction.cpp:78
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
IPO.h
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
DebugInfo.h
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::DICompileUnit
Compile unit.
Definition: DebugInfoMetadata.h:1335
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MDTuple::get
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition: Metadata.h:1170
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::SmallPtrSetImpl::count
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
Definition: SmallPtrSet.h:382
llvm::createStripSymbolsPass
ModulePass * createStripSymbolsPass(bool OnlyDebugInfo=false)
llvm::StructType
Class to represent struct types.
Definition: DerivedTypes.h:213
llvm::TypeFinder::run
void run(const Module &M, bool onlyNamed)
Definition: TypeFinder.cpp:32
llvm::TypeFinder
TypeFinder - Walk over a module, identifying all of the types that are used by the module.
Definition: TypeFinder.h:30
llvm::createStripDeadDebugInfoPass
ModulePass * createStripDeadDebugInfoPass()
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:297
llvm::Value::stripPointerCasts
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Definition: Value.cpp:675
INITIALIZE_PASS
INITIALIZE_PASS(StripSymbols, "strip", "Strip all symbols from a module", false, false) ModulePass *llvm
Definition: StripSymbols.cpp:103
llvm::StripDebugDeclarePass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: StripSymbols.cpp:405
llvm::AnalysisUsage::setPreservesAll
void setPreservesAll()
Set by analyses that do not transform their input at all.
Definition: PassAnalysisSupport.h:130
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:321
llvm::PreservedAnalyses::all
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: PassManager.h:161
StripSymtab
static void StripSymtab(ValueSymbolTable &ST, bool PreserveDbgInfo)
Definition: StripSymbols.cpp:167
llvm::createStripNonDebugSymbolsPass
ModulePass * createStripNonDebugSymbolsPass()
PassManager.h
stripDebugDeclareImpl
static bool stripDebugDeclareImpl(Module &M)
Definition: StripSymbols.cpp:254
llvm::initializeStripSymbolsPass
void initializeStripSymbolsPass(PassRegistry &)
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:585
Instructions.h
llvm::User::getNumOperands
unsigned getNumOperands() const
Definition: User.h:191
llvm::ValueSymbolTable
This class provides a symbol table of name/value pairs.
Definition: ValueSymbolTable.h:37
llvm::CallBase::getArgOperand
Value * getArgOperand(unsigned i) const
Definition: InstrTypes.h:1338
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1820
DerivedTypes.h
llvm::SmallPtrSetImpl
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:343
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1475
llvm::User::getOperand
Value * getOperand(unsigned i) const
Definition: User.h:169
llvm::NamedMDNode::clearOperands
void clearOperands()
Drop all references to this node's operands.
Definition: Metadata.cpp:1139
StripTypeNames
static void StripTypeNames(Module &M, bool PreserveDbgInfo)
Definition: StripSymbols.cpp:180
llvm::StructType::isLiteral
bool isLiteral() const
Return true if this type is uniqued by structural equivalence, false if it is a struct definition.
Definition: DerivedTypes.h:277
CU
Definition: AArch64AsmBackend.cpp:501
InitializePasses.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::Value::users
iterator_range< user_iterator > users()
Definition: Value.h:422
llvm::SmallPtrSetImpl::insert
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:364
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::SmallVectorImpl::insert
iterator insert(iterator I, T &&Elt)
Definition: SmallVector.h:773
StripSymbolNames
static bool StripSymbolNames(Module &M, bool PreserveDbgInfo)
StripSymbolNames - Strip symbol names.
Definition: StripSymbols.cpp:210
llvm::initializeStripNonDebugSymbolsPass
void initializeStripNonDebugSymbolsPass(PassRegistry &)