summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-02 21:56:57 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-02 21:56:57 +0000
commit571f97bd9055738e88c982564c06ba6d48ac7f9f (patch)
tree8853f1ba2183cc4f7d5c8fb454188b705e445e1a /llvm/lib/CodeGen/MachineInstr.cpp
parent02b418a875b630be83fad340e3a213701904617c (diff)
downloadbcm5719-llvm-571f97bd9055738e88c982564c06ba6d48ac7f9f.tar.gz
bcm5719-llvm-571f97bd9055738e88c982564c06ba6d48ac7f9f.zip
DI: Fold constant arguments into a single MDString
This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 218914
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index d33d4a9d26a..2e59f371826 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1643,11 +1643,11 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM,
if (isDebugValue() && MO.isMetadata()) {
// Pretty print DBG_VALUE instructions.
const MDNode *MD = MO.getMetadata();
- if (MD->getNumOperands() >= 2)
- if (const MDString *MDS = dyn_cast<MDString>(MD->getOperand(2)))
- OS << "!\"" << MDS->getString() << '\"';
- else
- MO.print(OS, TM);
+ DIDescriptor DI(MD);
+ DIVariable DIV(MD);
+
+ if (DI.isVariable() && !DIV.getName().empty())
+ OS << "!\"" << DIV.getName() << '\"';
else
MO.print(OS, TM);
} else if (TM && (isInsertSubreg() || isRegSequence()) && MO.isImm()) {
OpenPOWER on IntegriCloud