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

One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

llvm-svn: 283285
This commit is contained in:
Mehdi Amini
2016-10-05 01:04:02 +00:00
parent a28bb09f28
commit 2bcac0fac4
12 changed files with 185 additions and 199 deletions

View File

@@ -74,8 +74,7 @@ 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: ";
auto Lang = dwarf::LanguageString(CU->getSourceLanguage());
if (!Lang.empty())
if (const char *Lang = dwarf::LanguageString(CU->getSourceLanguage()))
O << Lang;
else
O << "unknown-language(" << CU->getSourceLanguage() << ")";
@@ -106,15 +105,14 @@ 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 << " ";
auto Encoding = dwarf::AttributeEncodingString(BT->getEncoding());
if (!Encoding.empty())
if (const char *Encoding =
dwarf::AttributeEncodingString(BT->getEncoding()))
O << Encoding;
else
O << "unknown-encoding(" << BT->getEncoding() << ')';
} else {
O << ' ';
auto Tag = dwarf::TagString(T->getTag());
if (!Tag.empty())
if (const char *Tag = dwarf::TagString(T->getTag()))
O << Tag;
else
O << "unknown-tag(" << T->getTag() << ")";