summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-04-17 03:41:36 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-04-17 03:41:36 +0000
commita205ea3151b5ee7f77255318e9bd10536410aca8 (patch)
tree299fed832af4e1702c832b8e2014d1a61a422766 /llvm/lib/IR
parentc9e6e9ed2a0e17d22af0571425d12df6f2e39547 (diff)
downloadbcm5719-llvm-a205ea3151b5ee7f77255318e9bd10536410aca8.tar.gz
bcm5719-llvm-a205ea3151b5ee7f77255318e9bd10536410aca8.zip
PR15149/r174304 improvement - print hex for unknown dwarf language codes & add a test case
CR feedback from Rafael Espindola and Paul Robinson. llvm-svn: 179664
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 0ffe99d7045..10beb698243 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -1054,8 +1054,13 @@ void DIScope::printInternal(raw_ostream &OS) const {
void DICompileUnit::printInternal(raw_ostream &OS) const {
DIScope::printInternal(OS);
- if (const char *Lang = dwarf::LanguageString(getLanguage()))
- OS << " [" << Lang << ']';
+ OS << " [";
+ unsigned Lang = getLanguage();
+ if (const char *LangStr = dwarf::LanguageString(Lang))
+ OS << LangStr;
+ else
+ (OS << "lang 0x").write_hex(Lang);
+ OS << ']';
}
void DIEnumerator::printInternal(raw_ostream &OS) const {
OpenPOWER on IntegriCloud