[ThinLTO] Create AliasSummary when building index

Summary:
Previously we were creating the alias summary on the fly while writing
the summary to bitcode. This moves the creation of these summaries to
the module summary index builder where we build the rest of the summary
index.

This is going to be necessary for setting the NoRename flag for values
possibly used in inline asm or module level asm.

Reviewers: mehdi_amini

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26049

llvm-svn: 285379
This commit is contained in:
Teresa Johnson
2016-10-28 02:39:38 +00:00
parent a0d9acafe1
commit 02563cd3a6
2 changed files with 27 additions and 7 deletions

View File

@@ -3434,7 +3434,9 @@ void ModuleBitcodeWriter::writePerModuleGlobalValueSummary() {
auto AliasId = VE.getValueID(&A);
auto AliaseeId = VE.getValueID(Aliasee);
NameVals.push_back(AliasId);
NameVals.push_back(getEncodedGVSummaryFlags(A));
auto *Summary = Index->getGlobalValueSummary(A);
AliasSummary *AS = cast<AliasSummary>(Summary);
NameVals.push_back(getEncodedGVSummaryFlags(AS->flags()));
NameVals.push_back(AliaseeId);
Stream.EmitRecord(bitc::FS_ALIAS, NameVals, FSAliasAbbrev);
NameVals.clear();