Skip to content

Commit

Permalink
Bitcode: Remove some dead code. Spotted by Teresa.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D33609

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304046 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
pcc committed May 26, 2017
1 parent 996f62f commit 4a5238d
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions lib/Bitcode/Writer/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3415,30 +3415,8 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {

// Create value IDs for undefined references.
forEachSummary([&](GVInfo I) {
if (auto *VS = dyn_cast<GlobalVarSummary>(I.second)) {
for (auto &RI : VS->refs())
assignValueId(RI.getGUID());
return;
}

auto *FS = dyn_cast<FunctionSummary>(I.second);
if (!FS)
return;
for (auto &RI : FS->refs())
for (auto &RI : I.second->refs())
assignValueId(RI.getGUID());

for (auto &EI : FS->calls()) {
GlobalValue::GUID GUID = EI.first.getGUID();
if (!hasValueId(GUID)) {
// For SamplePGO, the indirect call targets for local functions will
// have its original name annotated in profile. We try to find the
// corresponding PGOFuncName as the GUID.
GUID = Index.getGUIDFromOriginalID(GUID);
if (GUID == 0 || !hasValueId(GUID))
continue;
}
assignValueId(GUID);
}
});

for (const auto &GVI : valueIds()) {
Expand Down

0 comments on commit 4a5238d

Please sign in to comment.