summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-11 21:40:17 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-11 21:40:17 +0000
commitdb691cbd6dc2459d462d7d64322fedc02f564255 (patch)
treeb262f89c728c6d88e181ba221df39f2fcc15ca07 /llvm/lib/Bitcode
parent6616836e71c1080f2b5606bf6e7ff26e10783273 (diff)
downloadbcm5719-llvm-db691cbd6dc2459d462d7d64322fedc02f564255.tar.gz
bcm5719-llvm-db691cbd6dc2459d462d7d64322fedc02f564255.zip
Honour aliases visibility when reading from/writing to bitcode
llvm-svn: 48248
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp3
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index c1cfa975a71..27b5189d20d 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/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/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 67b13e30bad..aaad22688a4 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud