diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-07-02 21:07:45 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-07-02 21:07:45 +0000 |
commit | 5b868285ba86905d7719b0a4364b2a543ed7ec82 (patch) | |
tree | 68d152206af8dc521348f5334f7fafdd6a608629 /llvm/lib/Bitcode/Writer | |
parent | 48fe0fe884a34d5fe94e2de1495aae50cb76d6fd (diff) | |
download | bcm5719-llvm-5b868285ba86905d7719b0a4364b2a543ed7ec82.tar.gz bcm5719-llvm-5b868285ba86905d7719b0a4364b2a543ed7ec82.zip |
[ThinLTO] Address post-review suggestions for index-based WPD summary
Removes a couple of unnecessary and/or redundant checks introduced by
r364960.
llvm-svn: 364968
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 96e1d493aaf..837f883c5b9 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -3688,20 +3688,19 @@ void ModuleBitcodeWriterBase::writeModuleLevelReferences( // been initialized from a DenseSet. llvm::sort(NameVals.begin() + SizeBeforeRefs, NameVals.end()); - if (!VTableFuncs.empty()) { + if (VTableFuncs.empty()) + Stream.EmitRecord(bitc::FS_PERMODULE_GLOBALVAR_INIT_REFS, NameVals, + FSModRefsAbbrev); + else { // VTableFuncs pairs should already be sorted by offset. for (auto &P : VTableFuncs) { NameVals.push_back(VE.getValueID(P.FuncVI.getValue())); NameVals.push_back(P.VTableOffset); } - } - if (VTableFuncs.empty()) - Stream.EmitRecord(bitc::FS_PERMODULE_GLOBALVAR_INIT_REFS, NameVals, - FSModRefsAbbrev); - else Stream.EmitRecord(bitc::FS_PERMODULE_VTABLE_GLOBALVAR_INIT_REFS, NameVals, FSModVTableRefsAbbrev); + } NameVals.clear(); } @@ -3854,14 +3853,12 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() { NameVals.clear(); } - if (!Index->typeIdCompatibleVtableMap().empty()) { - for (auto &S : Index->typeIdCompatibleVtableMap()) { - writeTypeIdCompatibleVtableSummaryRecord(NameVals, StrtabBuilder, S.first, - S.second, VE); - Stream.EmitRecord(bitc::FS_TYPE_ID_METADATA, NameVals, - TypeIdCompatibleVtableAbbrev); - NameVals.clear(); - } + for (auto &S : Index->typeIdCompatibleVtableMap()) { + writeTypeIdCompatibleVtableSummaryRecord(NameVals, StrtabBuilder, S.first, + S.second, VE); + Stream.EmitRecord(bitc::FS_TYPE_ID_METADATA, NameVals, + TypeIdCompatibleVtableAbbrev); + NameVals.clear(); } Stream.ExitBlock(); |