[llvm] r271666 - AsmWriterEmitter.cpp assumes that all operands of a printed alias
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 3 06:17:40 PDT 2016
Author: sjoerdmeijer
Date: Fri Jun 3 08:17:37 2016
New Revision: 271666
URL: http://llvm.org/viewvc/llvm-project?rev=271666&view=rev
Log:
AsmWriterEmitter.cpp assumes that all operands of a printed alias
will appear after a blank. This assumption does not hold in the ARM
target.
Patch by: Roger Ferrer Ibanez
Differential Revision: http://reviews.llvm.org/D20234
Modified:
llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=271666&r1=271665&r2=271666&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Fri Jun 3 08:17:37 2016
@@ -1007,13 +1007,14 @@ void AsmWriterEmitter::EmitPrintAliasIns
// Code that prints the alias, replacing the operands with the ones from the
// MCInst.
O << " unsigned I = 0;\n";
- O << " while (AsmString[I] != ' ' && AsmString[I] != '\t' &&\n";
- O << " AsmString[I] != '\\0')\n";
+ O << " while (AsmString[I] != ' ' && AsmString[I] != '\\t' &&\n";
+ O << " AsmString[I] != '$' && AsmString[I] != '\\0')\n";
O << " ++I;\n";
O << " OS << '\\t' << StringRef(AsmString, I);\n";
O << " if (AsmString[I] != '\\0') {\n";
- O << " OS << '\\t';\n";
+ O << " if (AsmString[I] == ' ' || AsmString[I] == '\\t')";
+ O << " OS << '\\t';\n";
O << " do {\n";
O << " if (AsmString[I] == '$') {\n";
O << " ++I;\n";
More information about the llvm-commits
mailing list