diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp')
| -rw-r--r-- | gnu/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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<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() << ")"; |
