aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-12 00:49:19 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-12 00:49:19 +0000
commit5789f8d3dbbef204df19b2044de727e3063e1954 (patch)
tree3767609fea9b9d33f5153edecc8bad8f0d70e018 /lib/Bitcode/Reader
parentead436b69e5df9b2644e353a349f72fef7aff33b (diff)
downloadexternal_llvm-5789f8d3dbbef204df19b2044de727e3063e1954.zip
external_llvm-5789f8d3dbbef204df19b2044de727e3063e1954.tar.gz
external_llvm-5789f8d3dbbef204df19b2044de727e3063e1954.tar.bz2
Be backward compatible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 27b5189..a58ead5 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1075,6 +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)
@@ -1085,7 +1086,9 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) {
GlobalAlias *NewGA = new GlobalAlias(Ty, GetDecodedLinkage(Record[2]),
"", 0, TheModule);
- NewGA->setVisibility(GetDecodedVisibility(Record[3]));
+ // Old bitcode files didn't have visibility field.
+ if (Record.size() > 3)
+ NewGA->setVisibility(GetDecodedVisibility(Record[3]));
ValueList.push_back(NewGA);
AliasInits.push_back(std::make_pair(NewGA, Record[1]));
break;