Honour aliases visibility when reading from/writing to bitcode
authorAnton Korobeynikov <asl@math.spbu.ru>
Tue, 11 Mar 2008 21:40:17 +0000 (21:40 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Tue, 11 Mar 2008 21:40:17 +0000 (21:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48248 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp

index c1cfa975a7159a05475be2087aad55d9b67f2f6d..27b5189d20daccc3f2be28db87122c1516b60e2c 100644 (file)
@@ -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;
index 67b13e30bad185a2fd8f7c2ec31f744b65dfae27..aaad22688a41831b23fbf8ab5ddae3e2de4de4b8 100644 (file)
@@ -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();