Index: llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h =================================================================== --- llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h +++ llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h @@ -185,7 +185,10 @@ protected: GlobalValueSummary(SummaryKind K, GVFlags Flags, std::vector Refs) - : Kind(K), Flags(Flags), RefEdgeList(std::move(Refs)) {} + : Kind(K), Flags(Flags), RefEdgeList(std::move(Refs)) { + assert((K != AliasKind || Refs.empty()) && + "Expect no references for AliasSummary"); + } public: virtual ~GlobalValueSummary() = default; @@ -242,8 +245,8 @@ GlobalValueSummary *AliaseeSummary; public: - AliasSummary(GVFlags Flags, std::vector Refs) - : GlobalValueSummary(AliasKind, Flags, std::move(Refs)) {} + AliasSummary(GVFlags Flags) + : GlobalValueSummary(AliasKind, Flags, ArrayRef{}) {} /// Check if this is an alias summary. static bool classof(const GlobalValueSummary *GVS) { Index: llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cpp =================================================================== --- llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cpp +++ llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -343,7 +343,7 @@ bool NonRenamableLocal = isNonRenamableLocal(A); GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal, /* Live = */ false); - auto AS = llvm::make_unique(Flags, ArrayRef{}); + auto AS = llvm::make_unique(Flags); auto *Aliasee = A.getBaseObject(); auto *AliaseeSummary = Index.getGlobalValueSummary(*Aliasee); assert(AliaseeSummary && "Alias expects aliasee summary to be parsed"); Index: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp =================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp @@ -5159,8 +5159,7 @@ uint64_t RawFlags = Record[1]; unsigned AliaseeID = Record[2]; auto Flags = getDecodedGVSummaryFlags(RawFlags, Version); - auto AS = - llvm::make_unique(Flags, std::vector{}); + auto AS = llvm::make_unique(Flags); // The module path string ref set in the summary must be owned by the // index's module string table. Since we don't have a module path // string table section in the per-module index, we create a single @@ -5253,7 +5252,7 @@ uint64_t RawFlags = Record[2]; unsigned AliaseeValueId = Record[3]; auto Flags = getDecodedGVSummaryFlags(RawFlags, Version); - auto AS = llvm::make_unique(Flags, std::vector{}); + auto AS = llvm::make_unique(Flags); LastSeenSummary = AS.get(); AS->setModulePath(ModuleIdMap[ModuleId]);