26 if (Local || Delete) {
57 : Named(GVs.begin(), GVs.end()), deleteStuff(deleteS),
58 keepConstInit(keepConstInit) {}
63 M.setModuleInlineAsm(
"");
74 bool Delete = deleteStuff == (
bool)Named.count(&GV) &&
75 !GV.isDeclaration() && (!GV.isConstant() || !keepConstInit);
77 if (GV.hasAvailableExternallyLinkage())
79 if (GV.getName() ==
"llvm.global_ctors")
87 GV.setInitializer(
nullptr);
88 GV.setComdat(
nullptr);
94 bool Delete = deleteStuff == (
bool)Named.count(&
F) && !
F.isDeclaration();
96 if (
F.hasAvailableExternallyLinkage())
105 F.setComdat(
nullptr);
111 bool Delete = deleteStuff == (
bool)Named.count(&GA);
115 Type *Ty = GA.getValueType();
117 GA.removeFromParent();
121 GA.getAddressSpace(), GA.getName(), &M);
127 GA.replaceAllUsesWith(Declaration);
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A container for analyses that lazily runs them and caches their results.
Class to represent function types.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
bool hasLinkOnceLinkage() const
LinkageTypes getLinkage() const
bool hasLocalLinkage() const
void setLinkage(LinkageTypes LT)
@ HiddenVisibility
The GV is hidden.
void setVisibility(VisibilityTypes V)
static bool isDiscardableIfUnused(LinkageTypes Linkage)
Whether the definition of this global may be discarded if it is not used in its compilation unit.
@ LinkOnceAnyLinkage
Keep one copy of function when linking (inline)
@ WeakODRLinkage
Same, but only replaced by something equivalent.
@ ExternalLinkage
Externally visible function.
@ WeakAnyLinkage
Keep one copy of named function when linking (weak)
@ LinkOnceODRLinkage
Same, but only replaced by something equivalent.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...