diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-03-11 21:40:17 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-03-11 21:40:17 +0000 |
commit | f8342b98663096186c3a367f7d0fd5ebb7064a52 (patch) | |
tree | 9efd86b6c3b596939c3640a07997b2f777d2f8e9 /lib/Bitcode | |
parent | 6a6d27ac0b7607c0ad76a55bc4bd8897fe502c49 (diff) | |
download | external_llvm-f8342b98663096186c3a367f7d0fd5ebb7064a52.zip external_llvm-f8342b98663096186c3a367f7d0fd5ebb7064a52.tar.gz external_llvm-f8342b98663096186c3a367f7d0fd5ebb7064a52.tar.bz2 |
Honour aliases visibility when reading from/writing to bitcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 3 | ||||
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index c1cfa97..27b5189 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1075,7 +1075,7 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { FunctionsWithBodies.push_back(Func); break; } - // ALIAS: [alias type, aliasee val#, linkage] + // ALIAS: [alias type, aliasee val#, linkage, visibility] case bitc::MODULE_CODE_ALIAS: { if (Record.size() < 3) return Error("Invalid MODULE_ALIAS record"); @@ -1085,6 +1085,7 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { GlobalAlias *NewGA = new GlobalAlias(Ty, GetDecodedLinkage(Record[2]), "", 0, TheModule); + NewGA->setVisibility(GetDecodedVisibility(Record[3])); ValueList.push_back(NewGA); AliasInits.push_back(std::make_pair(NewGA, Record[1])); break; diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 67b13e3..aaad226 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -422,6 +422,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Vals.push_back(VE.getTypeID(AI->getType())); Vals.push_back(VE.getValueID(AI->getAliasee())); Vals.push_back(getEncodedLinkage(AI)); + Vals.push_back(getEncodedVisibility(AI)); unsigned AbbrevToUse = 0; Stream.EmitRecord(bitc::MODULE_CODE_ALIAS, Vals, AbbrevToUse); Vals.clear(); |