llvm.org GIT mirror llvm / 2eecf3f
[ThinLTO] Address post-review suggestions for index-based WPD summary Removes a couple of unnecessary and/or redundant checks introduced by r364960. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364968 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson a month ago
1 changed file(s) with 12 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
36873687 // been initialized from a DenseSet.
36883688 llvm::sort(NameVals.begin() + SizeBeforeRefs, NameVals.end());
36893689
3690 if (!VTableFuncs.empty()) {
3690 if (VTableFuncs.empty())
3691 Stream.EmitRecord(bitc::FS_PERMODULE_GLOBALVAR_INIT_REFS, NameVals,
3692 FSModRefsAbbrev);
3693 else {
36913694 // VTableFuncs pairs should already be sorted by offset.
36923695 for (auto &P : VTableFuncs) {
36933696 NameVals.push_back(VE.getValueID(P.FuncVI.getValue()));
36943697 NameVals.push_back(P.VTableOffset);
36953698 }
3696 }
3697
3698 if (VTableFuncs.empty())
3699 Stream.EmitRecord(bitc::FS_PERMODULE_GLOBALVAR_INIT_REFS, NameVals,
3700 FSModRefsAbbrev);
3701 else
3699
37023700 Stream.EmitRecord(bitc::FS_PERMODULE_VTABLE_GLOBALVAR_INIT_REFS, NameVals,
37033701 FSModVTableRefsAbbrev);
3702 }
37043703 NameVals.clear();
37053704 }
37063705
38533852 NameVals.clear();
38543853 }
38553854
3856 if (!Index->typeIdCompatibleVtableMap().empty()) {
3857 for (auto &S : Index->typeIdCompatibleVtableMap()) {
3858 writeTypeIdCompatibleVtableSummaryRecord(NameVals, StrtabBuilder, S.first,
3859 S.second, VE);
3860 Stream.EmitRecord(bitc::FS_TYPE_ID_METADATA, NameVals,
3861 TypeIdCompatibleVtableAbbrev);
3862 NameVals.clear();
3863 }
3855 for (auto &S : Index->typeIdCompatibleVtableMap()) {
3856 writeTypeIdCompatibleVtableSummaryRecord(NameVals, StrtabBuilder, S.first,
3857 S.second, VE);
3858 Stream.EmitRecord(bitc::FS_TYPE_ID_METADATA, NameVals,
3859 TypeIdCompatibleVtableAbbrev);
3860 NameVals.clear();
38643861 }
38653862
38663863 Stream.ExitBlock();