summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-12 18:32:50 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-12 18:32:50 +0000
commit749e4668e76ae37566a315b4ace09f306cceb25b (patch)
tree8e72739fa607eb1df1fb6e465f7bc87076ac6d1a /llvm/lib/Bytecode/Writer
parentce10cd22c88aa7cd5c407e7c71821f62e90eca32 (diff)
downloadbcm5719-llvm-749e4668e76ae37566a315b4ace09f306cceb25b.tar.gz
bcm5719-llvm-749e4668e76ae37566a315b4ace09f306cceb25b.zip
Implement the "thread_local" keyword.
llvm-svn: 35950
Diffstat (limited to 'llvm/lib/Bytecode/Writer')
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index dfc84be0378..c48bb223a80 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -950,7 +950,7 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
"Global must have an initializer or have external linkage!");
// Fields: bit0 = isConstant, bit1 = hasInitializer, bit2-4=Linkage,
- // bit5+ = Slot # for type.
+ // bit5 = isThreadLocal, bit6+ = Slot # for type.
bool HasExtensionWord = (I->getAlignment() != 0) ||
I->hasSection() ||
(I->getVisibility() != GlobalValue::DefaultVisibility);
@@ -958,12 +958,13 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
// If we need to use the extension byte, set linkage=3(internal) and
// initializer = 0 (impossible!).
if (!HasExtensionWord) {
- unsigned oSlot = (Slot << 5) | (getEncodedLinkage(I) << 2) |
- (I->hasInitializer() << 1) | (unsigned)I->isConstant();
+ unsigned oSlot = (Slot << 6)| (((unsigned)I->isThreadLocal()) << 5) |
+ (getEncodedLinkage(I) << 2) | (I->hasInitializer() << 1)
+ | (unsigned)I->isConstant();
output_vbr(oSlot);
} else {
- unsigned oSlot = (Slot << 5) | (3 << 2) |
- (0 << 1) | (unsigned)I->isConstant();
+ unsigned oSlot = (Slot << 6) | (((unsigned)I->isThreadLocal()) << 5) |
+ (3 << 2) | (0 << 1) | (unsigned)I->isConstant();
output_vbr(oSlot);
// The extension word has this format: bit 0 = has initializer, bit 1-3 =
OpenPOWER on IntegriCloud