mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user