summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-18 06:30:21 +0000
committerChris Lattner <sabre@nondot.org>2003-10-18 06:30:21 +0000
commitdc83293a38be16a89ce7f528859b45633757975b (patch)
treecc5afcd209431fe0779efa8c83c78d4a523aa2e3 /llvm/lib/Bytecode/Reader/Reader.cpp
parentb32f5748b70ed30d61b83f1486d8e3d48011f678 (diff)
downloadbcm5719-llvm-dc83293a38be16a89ce7f528859b45633757975b.tar.gz
bcm5719-llvm-dc83293a38be16a89ce7f528859b45633757975b.zip
add support for new linkage types
llvm-svn: 9228
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 1674786fb76..e338c41e526 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud