diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h index 868669987c8..70c46db0e97 100644 --- a/include/llvm/Support/Dwarf.h +++ b/include/llvm/Support/Dwarf.h @@ -17,7 +17,6 @@ #define LLVM_SUPPORT_DWARF_H #include "llvm/Support/DataTypes.h" -#include "llvm/ADT/StringRef.h" namespace llvm { @@ -803,14 +802,14 @@ enum GDBIndexEntryKind { GIEK_UNUSED7 }; -StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind); +const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind); enum GDBIndexEntryLinkage { GIEL_EXTERNAL, GIEL_STATIC }; -StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage); +const char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage); /// The gnu_pub* kind looks like: /// diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f45e2f24310..76d63c722b3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2426,7 +2426,7 @@ void DwarfDebug::emitDebugPubNames(bool GnuStyle) { if (GnuStyle) { dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheCU, Entity); Asm->OutStreamer.AddComment( - "Kind: " + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " + + Twine("Kind: ") + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " + dwarf::GDBIndexEntryLinkageString(Desc.Linkage)); Asm->EmitInt8(Desc.toBits()); } @@ -2488,7 +2488,7 @@ void DwarfDebug::emitDebugPubTypes(bool GnuStyle) { if (GnuStyle) { dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheCU, Entity); Asm->OutStreamer.AddComment( - "Kind: " + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " + + Twine("Kind: ") + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " + dwarf::GDBIndexEntryLinkageString(Desc.Linkage)); Asm->EmitInt8(Desc.toBits()); } diff --git a/lib/Support/Dwarf.cpp b/lib/Support/Dwarf.cpp index 0e64035c0bd..f4993454b68 100644 --- a/lib/Support/Dwarf.cpp +++ b/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";