summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Dwarf.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-09-20 00:33:15 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-09-20 00:33:15 +0000
commitefd0bcb70f102117b04f39e156140974dfa9063c (patch)
tree0793710760b427d0c8020e026469a9c8536f6854 /llvm/lib/Support/Dwarf.cpp
parent9d117ab7ef43ca94ff4b8fda523e2b8db3aede81 (diff)
downloadbcm5719-llvm-efd0bcb70f102117b04f39e156140974dfa9063c.tar.gz
bcm5719-llvm-efd0bcb70f102117b04f39e156140974dfa9063c.zip
DebugInfo: GDBIndexEntry*String conversion functions now return const char* for easy llvm::formating
This was previously invoking UB by passing a user-defined type to format. Thanks to Jordan Rose for pointing this out. llvm-svn: 191060
Diffstat (limited to 'llvm/lib/Support/Dwarf.cpp')
-rw-r--r--llvm/lib/Support/Dwarf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Dwarf.cpp b/llvm/lib/Support/Dwarf.cpp
index 0e64035c0bd..f4993454b68 100644
--- a/llvm/lib/Support/Dwarf.cpp
+++ b/llvm/lib/Support/Dwarf.cpp
@@ -742,7 +742,7 @@ const char *llvm::dwarf::AtomTypeString(unsigned AT) {
return 0;
}
-StringRef llvm::dwarf::GDBIndexEntryKindString(GDBIndexEntryKind Kind) {
+const char *llvm::dwarf::GDBIndexEntryKindString(GDBIndexEntryKind Kind) {
switch (Kind) {
case GIEK_NONE:
return "NONE";
@@ -764,7 +764,7 @@ StringRef llvm::dwarf::GDBIndexEntryKindString(GDBIndexEntryKind Kind) {
llvm_unreachable("Unknown GDBIndexEntryKind value");
}
-StringRef llvm::dwarf::GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage) {
+const char *llvm::dwarf::GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage) {
switch (Linkage) {
case GIEL_EXTERNAL:
return "EXTERNAL";
OpenPOWER on IntegriCloud