diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-18 06:30:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-18 06:30:21 +0000 |
commit | 22482a14be04acd36dd1564ece09caa8a941a93c (patch) | |
tree | 3d65bd8c9fb67d83e1b6c31d725304ef3d34e03f /lib/Bytecode/Reader | |
parent | 3c4a34e8db5057458d7590b85e9819b7b4c4a7b8 (diff) | |
download | external_llvm-22482a14be04acd36dd1564ece09caa8a941a93c.zip external_llvm-22482a14be04acd36dd1564ece09caa8a941a93c.tar.gz external_llvm-22482a14be04acd36dd1564ece09caa8a941a93c.tar.bz2 |
add support for new linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader')
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index 1674786..e338c41 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/lib/Bytecode/Reader/Reader.cpp @@ -434,14 +434,24 @@ void BytecodeParser::ParseModuleGlobalInfo(const unsigned char *&Buf, GlobalValue::LinkageTypes Linkage; if (!hasInternalMarkerOnly) { - // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, - // bit2,3 = Linkage, bit4+ = slot# - SlotNo = VarType >> 4; - switch ((VarType >> 2) & 3) { + unsigned LinkageID; + if (hasExtendedLinkageSpecs) { + // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, + // bit2,3,4 = Linkage, bit4+ = slot# + SlotNo = VarType >> 5; + LinkageID = (VarType >> 2) & 7; + } else { + // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, + // bit2,3 = Linkage, bit4+ = slot# + SlotNo = VarType >> 4; + LinkageID = (VarType >> 2) & 3; + } + switch (LinkageID) { case 0: Linkage = GlobalValue::ExternalLinkage; break; case 1: Linkage = GlobalValue::WeakLinkage; break; case 2: Linkage = GlobalValue::AppendingLinkage; break; case 3: Linkage = GlobalValue::InternalLinkage; break; + case 4: Linkage = GlobalValue::LinkOnceLinkage; break; } } else { // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, |