[opaque pointer types] Add an explicit pointee type to alias records in the IR

Since aliases actually use and verify their explicit type already, no
further invalid testing is required here. The
invalid.test:ALIAS-TYPE-MISMATCH case catches errors due to emitting a
non-pointee type in the new format or a non-pointer type in the old
format.

llvm-svn: 247952
This commit is contained in:
David Blaikie
2015-09-17 22:18:59 +00:00
parent bf19a11116
commit 6a51dbdb3c
3 changed files with 45 additions and 25 deletions

View File

@@ -756,7 +756,8 @@ static uint64_t WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
// Emit the alias information.
for (const GlobalAlias &A : M->aliases()) {
// ALIAS: [alias type, aliasee val#, linkage, visibility]
Vals.push_back(VE.getTypeID(A.getType()));
Vals.push_back(VE.getTypeID(A.getValueType()));
Vals.push_back(A.getType()->getAddressSpace());
Vals.push_back(VE.getValueID(A.getAliasee()));
Vals.push_back(getEncodedLinkage(A));
Vals.push_back(getEncodedVisibility(A));