summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Dwarf.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-09-19 18:39:59 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-09-19 18:39:59 +0000
commitecb41cfe36c9e60664c95970bfae82e4cf7397c5 (patch)
tree63f3db365fcdbaceadb4621ffb28ad0ab876af41 /include/llvm/Support/Dwarf.h
parentcdfb43f0a68274f40340af73218699265466c074 (diff)
downloadllvm-ecb41cfe36c9e60664c95970bfae82e4cf7397c5.tar.gz
llvm-ecb41cfe36c9e60664c95970bfae82e4cf7397c5.tar.bz2
llvm-ecb41cfe36c9e60664c95970bfae82e4cf7397c5.tar.xz
DebugInfo: Simplify gnu_pubnames index computation.
Names open to bikeshedding. Could switch back to the constants being unshifted, but this way seems a bit easier to work with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Dwarf.h')
-rw-r--r--include/llvm/Support/Dwarf.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h
index a1ed1d1c11..f06c4801fd 100644
--- a/include/llvm/Support/Dwarf.h
+++ b/include/llvm/Support/Dwarf.h
@@ -791,37 +791,34 @@ const char *AtomTypeString(unsigned Atom);
// Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
enum GDBIndex {
- // The full index looks like this for each symbol:
+ // The gnu_pub* index value looks like:
//
- // 0-23 CU index
- // 24-27 reserved
- // 28-30 symbol kind
- // 31 0 == global, 1 == static
- //
- // where each entry refers to the CU and some attributes about the symbol.
+ // 0-3 reserved
+ // 4-6 symbol kind
+ // 7 0 == global, 1 == static
// Attributes kinds for the index.
+ GDB_INDEX_SYMBOL_KIND_OFFSET = 4,
+ GDB_INDEX_SYMBOL_KIND_MASK = 7 << GDB_INDEX_SYMBOL_KIND_OFFSET,
// Special value to indicate no attributes are present.
GDB_INDEX_SYMBOL_KIND_NONE = 0,
- GDB_INDEX_SYMBOL_KIND_TYPE = 1,
- GDB_INDEX_SYMBOL_KIND_VARIABLE = 2,
- GDB_INDEX_SYMBOL_KIND_FUNCTION = 3,
- GDB_INDEX_SYMBOL_KIND_OTHER = 4,
- // 3 unused bits.
- GDB_INDEX_SYMBOL_KIND_UNUSED5 = 5,
- GDB_INDEX_SYMBOL_KIND_UNUSED6 = 6,
- GDB_INDEX_SYMBOL_KIND_UNUSED7 = 7,
+ GDB_INDEX_SYMBOL_KIND_TYPE = 1 << GDB_INDEX_SYMBOL_KIND_OFFSET,
+ GDB_INDEX_SYMBOL_KIND_VARIABLE = 2 << GDB_INDEX_SYMBOL_KIND_OFFSET,
+ GDB_INDEX_SYMBOL_KIND_FUNCTION = 3 << GDB_INDEX_SYMBOL_KIND_OFFSET,
+ GDB_INDEX_SYMBOL_KIND_OTHER = 4 << GDB_INDEX_SYMBOL_KIND_OFFSET,
+ // 3 unused values.
+ GDB_INDEX_SYMBOL_KIND_UNUSED5 = 5 << GDB_INDEX_SYMBOL_KIND_OFFSET,
+ GDB_INDEX_SYMBOL_KIND_UNUSED6 = 6 << GDB_INDEX_SYMBOL_KIND_OFFSET,
+ GDB_INDEX_SYMBOL_KIND_UNUSED7 = 7 << GDB_INDEX_SYMBOL_KIND_OFFSET,
// Index values are defined via the set of CUs that define the
// symbol. For the pubnames/pubtypes extensions we need the
// various shifts and masks.
- GDB_INDEX_SYMBOL_STATIC_SHIFT = 31,
- GDB_INDEX_SYMBOL_STATIC_MASK = 1,
- GDB_INDEX_SYMBOL_KIND_SHIFT = 28,
- GDB_INDEX_SYMBOL_KIND_MASK = 7,
- GDB_INDEX_CU_BITSIZE = 24,
- GDB_INDEX_CU_MASK = ((1 << GDB_INDEX_CU_BITSIZE) - 1)
+ GDB_INDEX_SYMBOL_STATIC_OFFSET = 7,
+ GDB_INDEX_SYMBOL_STATIC_MASK = 1 << GDB_INDEX_SYMBOL_STATIC_OFFSET,
+ GDB_INDEX_SYMBOL_STATIC = 1 << GDB_INDEX_SYMBOL_STATIC_OFFSET,
+ GDB_INDEX_SYMBOL_NON_STATIC = 0
};
/// GDBIndexTypeString - Return the string for the specified index type.