From 53d771aafdbe5b919f264f53cba3788e2c4cffd2 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 24 Jan 2017 08:32:59 +0000 Subject: Import LLVM 4.0.0 rc1 including clang and lld to help the current development effort on OpenBSD/arm64. --- gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp') diff --git a/gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp b/gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp index 36c47141a45..f675830aa67 100644 --- a/gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp +++ b/gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp @@ -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() << ")"; @@ -90,7 +91,8 @@ void ModuleDebugInfoPrinter::print(raw_ostream &O, const Module *M) const { O << '\n'; } - for (const DIGlobalVariable *GV : Finder.global_variables()) { + for (auto GVU : Finder.global_variables()) { + const auto *GV = GVU->getVariable(); O << "Global variable: " << GV->getName(); printFile(O, GV->getFilename(), GV->getDirectory(), GV->getLine()); if (!GV->getLinkageName().empty()) @@ -105,14 +107,15 @@ void ModuleDebugInfoPrinter::print(raw_ostream &O, const Module *M) const { printFile(O, T->getFilename(), T->getDirectory(), T->getLine()); if (auto *BT = dyn_cast(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() << ")"; -- cgit v1.2.3-59-g8ed1b