diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-07-07 05:14:21 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-07 05:14:21 +0000 |
commit | a54fe1acdc2df47c80f1eb319d7f8bcd65018aa9 (patch) | |
tree | a728612f146476f144e990c365a4b358b8b3a0e4 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 8aaf372bdfc197e661f28975da3fee0ce340eb3b (diff) | |
download | bcm5719-llvm-a54fe1acdc2df47c80f1eb319d7f8bcd65018aa9.tar.gz bcm5719-llvm-a54fe1acdc2df47c80f1eb319d7f8bcd65018aa9.zip |
[CodeView] Implement support for thread-local variables
llvm-svn: 274734
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 6e6a76e01a7..bb959e26a8e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1998,12 +1998,23 @@ void CodeViewDebug::emitDebugInfoForGlobal(const DIGlobalVariable *DIGV, OS.AddComment("Record length"); OS.emitAbsoluteSymbolDiff(DataEnd, DataBegin, 2); OS.EmitLabel(DataBegin); + const auto *GV = cast<GlobalVariable>(DIGV->getVariable()); if (DIGV->isLocalToUnit()) { - OS.AddComment("Record kind: S_LDATA32"); - OS.EmitIntValue(unsigned(SymbolKind::S_LDATA32), 2); + if (GV->isThreadLocal()) { + OS.AddComment("Record kind: S_LTHREAD32"); + OS.EmitIntValue(unsigned(SymbolKind::S_LTHREAD32), 2); + } else { + OS.AddComment("Record kind: S_LDATA32"); + OS.EmitIntValue(unsigned(SymbolKind::S_LDATA32), 2); + } } else { - OS.AddComment("Record kind: S_GDATA32"); - OS.EmitIntValue(unsigned(SymbolKind::S_GDATA32), 2); + if (GV->isThreadLocal()) { + OS.AddComment("Record kind: S_GTHREAD32"); + OS.EmitIntValue(unsigned(SymbolKind::S_GTHREAD32), 2); + } else { + OS.AddComment("Record kind: S_GDATA32"); + OS.EmitIntValue(unsigned(SymbolKind::S_GDATA32), 2); + } } OS.AddComment("Type"); OS.EmitIntValue(getCompleteTypeIndex(DIGV->getType()).getIndex(), 4); |