summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@mips.com>2017-11-13 18:00:24 +0000
committerPetar Jovanovic <petar.jovanovic@mips.com>2017-11-13 18:00:24 +0000
commitbd57b8bf3f8244545f6a58a668486f9801f3c43d (patch)
treecedf6b4ee21d7743c300a01caf870ff7fb945d7d
parent20df88a754b39fb8d7e05377935fc6b00469f659 (diff)
downloadbcm5719-llvm-bd57b8bf3f8244545f6a58a668486f9801f3c43d.tar.gz
bcm5719-llvm-bd57b8bf3f8244545f6a58a668486f9801f3c43d.zip
fix printing of alias instructions by removing redundant spacing
Some alias instructions are printed with an extra space after the tab character. Fix this by skipping that space when the tab character is printed so that the instructions are aligned with the rest of the code. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D35946 llvm-svn: 318059
-rw-r--r--llvm/utils/TableGen/AsmWriterEmitter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 75b9bc6cca4..52b4c39255f 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -1024,8 +1024,10 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
O << " OS << '\\t' << StringRef(AsmString, I);\n";
O << " if (AsmString[I] != '\\0') {\n";
- O << " if (AsmString[I] == ' ' || AsmString[I] == '\\t')";
+ O << " if (AsmString[I] == ' ' || AsmString[I] == '\\t') {\n";
O << " OS << '\\t';\n";
+ O << " ++I;\n";
+ O << " }\n";
O << " do {\n";
O << " if (AsmString[I] == '$') {\n";
O << " ++I;\n";
OpenPOWER on IntegriCloud