Skip to content

Commit 3c2f785

Browse files
author
Sjoerd Meijer
committedJun 3, 2016
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 llvm-svn: 271666
1 parent 84e2f69 commit 3c2f785

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎llvm/utils/TableGen/AsmWriterEmitter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,13 +1007,14 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
10071007
// Code that prints the alias, replacing the operands with the ones from the
10081008
// MCInst.
10091009
O << " unsigned I = 0;\n";
1010-
O << " while (AsmString[I] != ' ' && AsmString[I] != '\t' &&\n";
1011-
O << " AsmString[I] != '\\0')\n";
1010+
O << " while (AsmString[I] != ' ' && AsmString[I] != '\\t' &&\n";
1011+
O << " AsmString[I] != '$' && AsmString[I] != '\\0')\n";
10121012
O << " ++I;\n";
10131013
O << " OS << '\\t' << StringRef(AsmString, I);\n";
10141014

10151015
O << " if (AsmString[I] != '\\0') {\n";
1016-
O << " OS << '\\t';\n";
1016+
O << " if (AsmString[I] == ' ' || AsmString[I] == '\\t')";
1017+
O << " OS << '\\t';\n";
10171018
O << " do {\n";
10181019
O << " if (AsmString[I] == '$') {\n";
10191020
O << " ++I;\n";

0 commit comments

Comments
 (0)
Please sign in to comment.