diff options
-rw-r--r-- | lib/IR/DebugInfo.cpp | 9 | ||||
-rw-r--r-- | test/DebugInfo/2010-03-19-DbgDeclare.ll | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 0ffe99d..10beb69 100644 --- a/lib/IR/DebugInfo.cpp +++ b/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 { diff --git a/test/DebugInfo/2010-03-19-DbgDeclare.ll b/test/DebugInfo/2010-03-19-DbgDeclare.ll index 1f7a889..4f49103 100644 --- a/test/DebugInfo/2010-03-19-DbgDeclare.ll +++ b/test/DebugInfo/2010-03-19-DbgDeclare.ll @@ -1,12 +1,17 @@ -; RUN: llvm-as < %s | opt -verify -disable-output +; RUN: llvm-as < %s | opt -verify -S -asm-verbose | FileCheck %s + +; CHECK: lang 0x8001 define void @Foo(i32 %a, i32 %b) { entry: call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1) ret void } - +!llvm.dbg.cu = !{!2} +!2 = metadata !{i32 786449, metadata !4, i32 32769, metadata !"clang version 3.3 ", i1 false, metadata !"", i32 0, metadata !3, metadata !3, metadata !3, metadata !3, metadata !""} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/blaikie/dev/scratch/scratch.cpp] [lang 0x8001] +!3 = metadata !{} !0 = metadata !{i32 662302, i32 26, metadata !1, null} !1 = metadata !{i32 4, metadata !"foo"} +!4 = metadata !{metadata !"scratch.cpp", metadata !"/usr/local/google/home/blaikie/dev/scratch"} declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone |