summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-28 18:15:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-28 18:15:43 +0000
commit59f7eba2b546e4118434b0ea9de5e08c316a64b1 (patch)
tree16f393a8b64f8652acb4a735aa2b8dc81c8fa064 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent555132824a9e28993a22c1fb1933287999d5733a (diff)
downloadbcm5719-llvm-59f7eba2b546e4118434b0ea9de5e08c316a64b1.tar.gz
bcm5719-llvm-59f7eba2b546e4118434b0ea9de5e08c316a64b1.zip
[pr19844] Add thread local mode to aliases.
This matches gcc's behavior. It also seems natural given that aliases contain other properties that govern how it is accessed (linkage, visibility, dll storage). Clang still has to be updated to expose this feature to C. llvm-svn: 209759
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index cc73b842e33..dddcbc6f7e0 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -511,7 +511,7 @@ static unsigned getEncodedDLLStorageClass(const GlobalValue &GV) {
llvm_unreachable("Invalid DLL storage class");
}
-static unsigned getEncodedThreadLocalMode(const GlobalVariable &GV) {
+static unsigned getEncodedThreadLocalMode(const GlobalValue &GV) {
switch (GV.getThreadLocalMode()) {
case GlobalVariable::NotThreadLocal: return 0;
case GlobalVariable::GeneralDynamicTLSModel: return 1;
@@ -668,6 +668,8 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
Vals.push_back(getEncodedLinkage(A));
Vals.push_back(getEncodedVisibility(A));
Vals.push_back(getEncodedDLLStorageClass(A));
+ if (A.isThreadLocal())
+ Vals.push_back(getEncodedThreadLocalMode(A));
unsigned AbbrevToUse = 0;
Stream.EmitRecord(bitc::MODULE_CODE_ALIAS, Vals, AbbrevToUse);
Vals.clear();
OpenPOWER on IntegriCloud