diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-06-15 00:33:47 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-06-15 00:33:47 +0000 |
commit | 2dbebcfedec350a042fc515d5da9e7330a713abe (patch) | |
tree | 6a5bed821899b786152ace0656cf7a4913317f16 /llvm/lib/CodeGen | |
parent | 2a74f708bc3ccb0f5c0752b463b49d19766de3e7 (diff) | |
download | bcm5719-llvm-2dbebcfedec350a042fc515d5da9e7330a713abe.tar.gz bcm5719-llvm-2dbebcfedec350a042fc515d5da9e7330a713abe.zip |
Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments if the display name is empty
llvm-svn: 184026
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<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. |