summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp')
-rw-r--r--contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp b/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp
index 36c4714..f675830 100644
--- a/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp
+++ b/contrib/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<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() << ")";
OpenPOWER on IntegriCloud