summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-09-09 20:03:11 +0000
committerEric Christopher <echristo@gmail.com>2013-09-09 20:03:11 +0000
commitadd00faa9681378cd9dbad22447c3b60116869f9 (patch)
tree51a18a5ce722a65f95a0d8f2f924cf1bbd318045
parente5679d8f5b3974bcfa7397e7277f03c92325773d (diff)
downloadbcm5719-llvm-add00faa9681378cd9dbad22447c3b60116869f9.tar.gz
bcm5719-llvm-add00faa9681378cd9dbad22447c3b60116869f9.zip
Add constant defines for gnu pubnames and gnu pubtypes - they're used
for the gdb index as the names convey. llvm-svn: 190343
-rw-r--r--llvm/include/llvm/Support/Dwarf.h17
-rw-r--r--llvm/lib/Support/Dwarf.cpp23
2 files changed, 40 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/Dwarf.h b/llvm/include/llvm/Support/Dwarf.h
index 0e00761bf3c..a31c3f131be 100644
--- a/llvm/include/llvm/Support/Dwarf.h
+++ b/llvm/include/llvm/Support/Dwarf.h
@@ -789,6 +789,23 @@ enum AcceleratorTable {
/// AtomTypeString - Return the string for the specified Atom type.
const char *AtomTypeString(unsigned Atom);
+// Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
+enum GDBIndex {
+ // 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
+};
+
+/// GDBIndexTypeString - Return the string for the specified index type.
+const char *GDBIndexTypeString(unsigned Kind);
+
} // End of namespace dwarf
} // End of namespace llvm
diff --git a/llvm/lib/Support/Dwarf.cpp b/llvm/lib/Support/Dwarf.cpp
index 3bacdd35793..5c780ddc2b8 100644
--- a/llvm/lib/Support/Dwarf.cpp
+++ b/llvm/lib/Support/Dwarf.cpp
@@ -739,3 +739,26 @@ const char *llvm::dwarf::AtomTypeString(unsigned AT) {
}
return 0;
}
+
+const char *llvm::dwarf::GDBIndexTypeString(unsigned Kind) {
+ switch (Kind) {
+ case GDB_INDEX_SYMBOL_KIND_NONE:
+ return "case GDB_INDEX_SYMBOL_KIND_NONE";
+ case GDB_INDEX_SYMBOL_KIND_TYPE:
+ return "case GDB_INDEX_SYMBOL_KIND_TYPE";
+ case GDB_INDEX_SYMBOL_KIND_VARIABLE:
+ return "case GDB_INDEX_SYMBOL_KIND_VARIABLE";
+ case GDB_INDEX_SYMBOL_KIND_FUNCTION:
+ return "case GDB_INDEX_SYMBOL_KIND_FUNCTION";
+ case GDB_INDEX_SYMBOL_KIND_OTHER:
+ return "case GDB_INDEX_SYMBOL_KIND_OTHER";
+ // 3 unused bits.
+ case GDB_INDEX_SYMBOL_KIND_UNUSED5:
+ return "case GDB_INDEX_SYMBOL_KIND_UNUSED5";
+ case GDB_INDEX_SYMBOL_KIND_UNUSED6:
+ return "case GDB_INDEX_SYMBOL_KIND_UNUSED6";
+ case GDB_INDEX_SYMBOL_KIND_UNUSED7:
+ return "case GDB_INDEX_SYMBOL_KIND_UNUSED7";
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud