summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Mitton <richard@codersnotes.com>2013-10-07 18:39:18 +0000
committerRichard Mitton <richard@codersnotes.com>2013-10-07 18:39:18 +0000
commit379f76e873b91550e3d9cee79dff814e3ce1e86e (patch)
tree33f25173894868c9df00fe87bc9279394b38d406
parentc4a8c07f6489c0081207f722ce0a4502614aef69 (diff)
downloadllvm-379f76e873b91550e3d9cee79dff814e3ce1e86e.tar.gz
llvm-379f76e873b91550e3d9cee79dff814e3ce1e86e.tar.bz2
llvm-379f76e873b91550e3d9cee79dff814e3ce1e86e.tar.xz
Formally added an explicit enum for DWARF TLS support. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192118 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/Dwarf.h3
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp7
-rw-r--r--lib/Support/Dwarf.cpp7
3 files changed, 11 insertions, 6 deletions
diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h
index 0f33541438..f4a9acf21a 100644
--- a/include/llvm/Support/Dwarf.h
+++ b/include/llvm/Support/Dwarf.h
@@ -486,6 +486,9 @@ enum Constants {
DW_OP_lo_user = 0xe0,
DW_OP_hi_user = 0xff,
+ // Extensions for GNU-style thread-local storage.
+ DW_OP_GNU_push_tls_address = 0xe0,
+
// Extensions for Fission proposal.
DW_OP_GNU_addr_index = 0xfb,
DW_OP_GNU_const_index = 0xfc,
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 4d51e73fd6..158a44e2e8 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -1505,14 +1505,15 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
// 1) Start with a constNu of the appropriate pointer size
addUInt(Block, 0, dwarf::DW_FORM_data1,
PointerSize == 4 ? dwarf::DW_OP_const4u : dwarf::DW_OP_const8u);
- // 2) containing the (relocated) address of the TLS variable
+ // 2) containing the (relocated) offset of the TLS variable
+ // within the module's TLS block.
addExpr(Block, 0, dwarf::DW_FORM_udata, Expr);
} else {
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index);
addUInt(Block, 0, dwarf::DW_FORM_udata, DU->getAddrPoolIndex(Expr));
}
- // 3) followed by a custom OP to tell the debugger about TLS (presumably)
- addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_lo_user);
+ // 3) followed by a custom OP to make the debugger do a TLS lookup.
+ addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_push_tls_address);
} else
addOpAddress(Block, Sym);
// Do not create specification DIE if context is either compile unit
diff --git a/lib/Support/Dwarf.cpp b/lib/Support/Dwarf.cpp
index f4993454b6..c000b636cc 100644
--- a/lib/Support/Dwarf.cpp
+++ b/lib/Support/Dwarf.cpp
@@ -456,10 +456,11 @@ const char *llvm::dwarf::OperationEncodingString(unsigned Encoding) {
case DW_OP_bit_piece: return "DW_OP_bit_piece";
case DW_OP_implicit_value: return "DW_OP_implicit_value";
case DW_OP_stack_value: return "DW_OP_stack_value";
- case DW_OP_lo_user: return "DW_OP_lo_user";
- case DW_OP_hi_user: return "DW_OP_hi_user";
- // DWARF5 Fission Proposal Op Extensions
+ // GNU thread-local storage
+ case DW_OP_GNU_push_tls_address: return "DW_OP_GNU_push_tls_address";
+
+ // DWARF5 Fission Proposal Op Extensions
case DW_OP_GNU_addr_index: return "DW_OP_GNU_addr_index";
case DW_OP_GNU_const_index: return "DW_OP_GNU_const_index";
}