[AArch64][AsmParser] Fix bug in operand printer
authorCullen Rhodes <cullen.rhodes@arm.com>
Tue, 25 Aug 2020 12:27:15 +0000 (12:27 +0000)
committerCullen Rhodes <cullen.rhodes@arm.com>
Wed, 26 Aug 2020 09:31:36 +0000 (09:31 +0000)
The switch in AArch64Operand::print was changed in D45688 so the shift
can be printed after printing the register. This is implemented with
LLVM_FALLTHROUGH and was broken in D52485 when BTIHint was put between
the register and shift operands.

Reviewed By: ostannard

Differential Revision: https://reviews.llvm.org/D86535

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

index b8d3757..2fe43f9 100644 (file)
@@ -2071,14 +2071,14 @@ void AArch64Operand::print(raw_ostream &OS) const {
   case k_PSBHint:
     OS << getPSBHintName();
     break;
+  case k_BTIHint:
+    OS << getBTIHintName();
+    break;
   case k_Register:
     OS << "<register " << getReg() << ">";
     if (!getShiftExtendAmount() && !hasShiftExtendAmount())
       break;
     LLVM_FALLTHROUGH;
-  case k_BTIHint:
-    OS << getBTIHintName();
-    break;
   case k_ShiftExtend:
     OS << "<" << AArch64_AM::getShiftExtendName(getShiftExtendType()) << " #"
        << getShiftExtendAmount();