diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-11-23 21:55:57 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-11-23 21:55:57 +0000 |
commit | 700515fa929495428201f9d19198dd4bab4ec35e (patch) | |
tree | e523f08b3cb235e7ababd995f805e7b52aba3d82 /llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp | |
parent | 2e1d85a09e140e6c41e8b575511e43df28186eb2 (diff) | |
download | llvm-700515fa929495428201f9d19198dd4bab4ec35e.zip llvm-700515fa929495428201f9d19198dd4bab4ec35e.tar.gz llvm-700515fa929495428201f9d19198dd4bab4ec35e.tar.bz2 |
[WebAssembly] Suffix output operands with '='.
This distinguishes input operands from output operands. This is something of
a syntactic experiment to see whether the mild amount of clutter this adds is
outweighed by the extra information it conveys to the reader.
llvm-svn: 253922
Diffstat (limited to 'llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp index a53a7cd..d5ffcbb 100644 --- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp +++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp @@ -90,6 +90,9 @@ void WebAssemblyInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, O << "$push" << (WAReg & INT32_MAX); else O << "$discard"; + // Add a '=' suffix if this is a def. + if (OpNo < MII.get(MI->getOpcode()).getNumDefs()) + O << '='; } else if (Op.isImm()) { switch (MI->getOpcode()) { case WebAssembly::PARAM: |