Re-commit "Use StringRef in Support/Darf APIs (NFC)"

This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini
2016-10-05 00:37:18 +00:00
parent d277734b71
commit a2df9c87e9
11 changed files with 142 additions and 128 deletions
+6 -4
View File
@@ -74,7 +74,8 @@ void ModuleDebugInfoPrinter::print(raw_ostream &O, const Module *M) const {
// filenames), so just print a few useful things.
for (DICompileUnit *CU : Finder.compile_units()) {
O << "Compile unit: ";
if (const char *Lang = dwarf::LanguageString(CU->getSourceLanguage()))
auto Lang = dwarf::LanguageString(CU->getSourceLanguage());
if (!Lang.empty())
O << Lang;
else
O << "unknown-language(" << CU->getSourceLanguage() << ")";
@@ -105,14 +106,15 @@ void ModuleDebugInfoPrinter::print(raw_ostream &O, const Module *M) const {
printFile(O, T->getFilename(), T->getDirectory(), T->getLine());
if (auto *BT = dyn_cast<DIBasicType>(T)) {
O << " ";
if (const char *Encoding =
dwarf::AttributeEncodingString(BT->getEncoding()))
auto Encoding = dwarf::AttributeEncodingString(BT->getEncoding());
if (!Encoding.empty())
O << Encoding;
else
O << "unknown-encoding(" << BT->getEncoding() << ')';
} else {
O << ' ';
if (const char *Tag = dwarf::TagString(T->getTag()))
auto Tag = dwarf::TagString(T->getTag());
if (!Tag.empty())
O << Tag;
else
O << "unknown-tag(" << T->getTag() << ")";