diff options
author | Fangrui Song <i@maskray.me> | 2021-02-23 16:09:05 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-02-23 16:09:06 -0800 |
commit | ef312951fd6b4a255baf3cff27439c9ed8751651 (patch) | |
tree | 4b88de287cef66f68fce79ad4497e54763cde88a /llvm/lib/IR/Module.cpp | |
parent | ed02f52d288fb4d8f9049868afa6af84a980cbc3 (diff) | |
download | llvm-ef312951fd6b4a255baf3cff27439c9ed8751651.zip llvm-ef312951fd6b4a255baf3cff27439c9ed8751651.tar.gz llvm-ef312951fd6b4a255baf3cff27439c9ed8751651.tar.bz2 |
collectUsedGlobalVariables: migrate SmallPtrSetImpl overload to SmallVecImpl overload after D97128
And delete the SmallPtrSetImpl overload.
While here, decrease inline element counts from 8 to 4. See D97128 for the choice.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D97257
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r-- | llvm/lib/IR/Module.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index 4c24461..60056f1 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -673,21 +673,6 @@ GlobalVariable *llvm::collectUsedGlobalVariables( return GV; } -GlobalVariable *llvm::collectUsedGlobalVariables( - const Module &M, SmallPtrSetImpl<GlobalValue *> &Set, bool CompilerUsed) { - const char *Name = CompilerUsed ? "llvm.compiler.used" : "llvm.used"; - GlobalVariable *GV = M.getGlobalVariable(Name); - if (!GV || !GV->hasInitializer()) - return GV; - - const ConstantArray *Init = cast<ConstantArray>(GV->getInitializer()); - for (Value *Op : Init->operands()) { - GlobalValue *G = cast<GlobalValue>(Op->stripPointerCasts()); - Set.insert(G); - } - return GV; -} - void Module::setPartialSampleProfileRatio(const ModuleSummaryIndex &Index) { if (auto *SummaryMD = getProfileSummary(/*IsCS*/ false)) { std::unique_ptr<ProfileSummary> ProfileSummary( |