From 2dbebcfedec350a042fc515d5da9e7330a713abe Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 15 Jun 2013 00:33:47 +0000 Subject: Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments if the display name is empty llvm-svn: 184026 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 69ff3290573..7f4ba7a0d93 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -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(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. -- cgit v1.2.3