diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
commit | b915e9e0fc85ba6f398b3fab0db6a81a8913af94 (patch) | |
tree | 98b8f811c7aff2547cab8642daf372d6c59502fb /lib/Analysis/ModuleDebugInfoPrinter.cpp | |
parent | 6421cca32f69ac849537a3cff78c352195e99f1b (diff) |
Notes
Diffstat (limited to 'lib/Analysis/ModuleDebugInfoPrinter.cpp')
-rw-r--r-- | lib/Analysis/ModuleDebugInfoPrinter.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Analysis/ModuleDebugInfoPrinter.cpp b/lib/Analysis/ModuleDebugInfoPrinter.cpp index 36c47141a45f..f675830aa67d 100644 --- a/lib/Analysis/ModuleDebugInfoPrinter.cpp +++ b/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() << ")"; |