[llvm] r256164 - [WebAssembly] Add some comments and make some minor source cleanups.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 21 08:50:41 PST 2015
Author: djg
Date: Mon Dec 21 10:50:41 2015
New Revision: 256164
URL: http://llvm.org/viewvc/llvm-project?rev=256164&view=rev
Log:
[WebAssembly] Add some comments and make some minor source cleanups.
Modified:
llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
Modified: llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp?rev=256164&r1=256163&r2=256164&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp Mon Dec 21 10:50:41 2015
@@ -24,7 +24,6 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Target/TargetRegisterInfo.h"
-#include <cctype>
using namespace llvm;
#define DEBUG_TYPE "asm-printer"
@@ -46,17 +45,19 @@ void WebAssemblyInstPrinter::printRegNam
void WebAssemblyInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
StringRef Annot,
const MCSubtargetInfo & /*STI*/) {
+ // Print the instruction (this uses the AsmStrings from the .td files).
printInstruction(MI, OS);
+ // Print any additional variadic operands.
const MCInstrDesc &Desc = MII.get(MI->getOpcode());
if (Desc.isVariadic())
- for (unsigned i = Desc.getNumOperands(), e = MI->getNumOperands(); i < e;
- ++i) {
+ for (auto i = Desc.getNumOperands(), e = MI->getNumOperands(); i < e; ++i) {
if (i != 0)
OS << ", ";
printOperand(MI, i, OS);
}
+ // Print any added annotation.
printAnnotation(OS, Annot);
}
More information about the llvm-commits
mailing list