33 if (Local || Delete) {
68 explicit GVExtractorPass(std::vector<GlobalValue*>& GVs,
bool deleteS =
true)
71 bool runOnModule(
Module &M) {
87 deleteStuff == (
bool)Named.count(
I) && !
I->isDeclaration();
89 if (
I->hasAvailableExternallyLinkage())
91 if (
I->getName() ==
"llvm.global_ctors")
104 deleteStuff == (
bool)Named.count(
I) && !
I->isDeclaration();
106 if (
I->hasAvailableExternallyLinkage())
122 bool Delete = deleteStuff == (
bool)Named.count(CurI);
126 Type *Ty = CurI->getType()->getElementType();
128 CurI->removeFromParent();
132 CurI->getName(), &M);
140 CurI->replaceAllUsesWith(Declaration);
154 return new GVExtractorPass(GVs, deleteFn);
void setVisibility(VisibilityTypes V)
const_iterator end(StringRef path)
Get end iterator over path.
LinkageTypes getLinkage() const
The main container class for the LLVM Intermediate Representation.
Same, but only replaced by something equivalent.
Externally visible function.
const_iterator begin(StringRef path)
Get begin iterator over path.
#define llvm_unreachable(msg)
void setModuleInlineAsm(StringRef Asm)
Set the module-scope inline assembly blocks.
ID
LLVM Calling Convention Representation.
global_iterator global_begin()
Same, but only replaced by something equivalent.
alias_iterator alias_end()
static bool isDiscardableIfUnused(LinkageTypes Linkage)
global_iterator global_end()
Keep one copy of function when linking (inline)
alias_iterator alias_begin()
void setLinkage(LinkageTypes LT)
bool hasLinkOnceLinkage() const
Keep one copy of named function when linking (weak)
bool hasLocalLinkage() const
LLVM Value Representation.
A vector that has set insertion semantics.
ModulePass * createGVExtractionPass(std::vector< GlobalValue * > &GVs, bool deleteFn=false)
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=0)