Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments if the display name is empty

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2013-06-15 00:33:47 +00:00
parent f3f3523b9c
commit 702ff96ff3
2 changed files with 6 additions and 3 deletions

View File

@ -562,8 +562,11 @@ static bool emitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
// cast away const; DIetc do not take const operands for some reason.
DIVariable V(const_cast<MDNode*>(MI->getOperand(2).getMetadata()));
if (V.getContext().isSubprogram())
OS << DISubprogram(V.getContext()).getDisplayName() << ":";
if (V.getContext().isSubprogram()) {
StringRef Name = DISubprogram(V.getContext()).getDisplayName();
if (!Name.empty())
OS << Name << ":";
}
OS << V.getName() << " <- ";
// Register or immediate value. Register 0 means undef.

View File

@ -6,7 +6,7 @@
; terminator.
;
; CHECK: test:
; CHECK: ##DEBUG_VALUE: :i
; CHECK: ##DEBUG_VALUE: i
%a = type { i32, i32 }
define hidden fastcc %a* @test() #1 {