diff options
Diffstat (limited to 'llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp')
| -rw-r--r-- | llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp index be66790c4277..e9d96f3b838d 100644 --- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -3858,7 +3858,7 @@ bool AArch64AsmParser::parseSysAlias(StringRef Name, SMLoc NameLoc, Lex(); // Eat operand. - bool ExpectRegister = (Op.lower().find("all") == StringRef::npos); + bool ExpectRegister = !Op.contains_insensitive("all"); bool HasRegister = false; // Check for the optional register operand. @@ -6110,6 +6110,9 @@ bool AArch64AsmParser::showMatchError(SMLoc Loc, unsigned ErrCode, case Match_AddSubLSLImm3ShiftLarge: return Error(Loc, "expected 'lsl' with optional integer in range [0, 7]"); + case Match_InvalidSVEPNRasPPRPredicateBReg: + return Error(Loc, + "Expected predicate-as-counter register name with .B suffix"); default: llvm_unreachable("unexpected error code!"); } @@ -6690,6 +6693,7 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, case Match_InvalidSVEVectorListStrided4x16: case Match_InvalidSVEVectorListStrided4x32: case Match_InvalidSVEVectorListStrided4x64: + case Match_InvalidSVEPNRasPPRPredicateBReg: case Match_MSR: case Match_MRS: { if (ErrorInfo >= Operands.size()) @@ -6864,7 +6868,7 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) { std::tie(Arch, ExtensionString) = getParser().parseStringToEndOfStatement().trim().split('+'); - std::optional<AArch64::ArchInfo> ArchInfo = AArch64::parseArch(Arch); + const AArch64::ArchInfo *ArchInfo = AArch64::parseArch(Arch); if (!ArchInfo) return Error(ArchLoc, "unknown arch name"); @@ -6890,12 +6894,7 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) { FeatureBitset Features = STI.getFeatureBits(); setAvailableFeatures(ComputeAvailableFeatures(Features)); for (auto Name : RequestedExtensions) { - bool EnableFeature = true; - - if (Name.starts_with_insensitive("no")) { - EnableFeature = false; - Name = Name.substr(2); - } + bool EnableFeature = !Name.consume_front_insensitive("no"); for (const auto &Extension : ExtensionMap) { if (Extension.Name != Name) @@ -6971,7 +6970,7 @@ bool AArch64AsmParser::parseDirectiveCPU(SMLoc L) { if (!ExtensionString.empty()) ExtensionString.split(RequestedExtensions, '+'); - const std::optional<llvm::AArch64::ArchInfo> CpuArch = llvm::AArch64::getArchForCpu(CPU); + const llvm::AArch64::ArchInfo *CpuArch = llvm::AArch64::getArchForCpu(CPU); if (!CpuArch) { Error(CurLoc, "unknown CPU name"); return false; @@ -6986,12 +6985,7 @@ bool AArch64AsmParser::parseDirectiveCPU(SMLoc L) { // Advance source location past '+'. CurLoc = incrementLoc(CurLoc, 1); - bool EnableFeature = true; - - if (Name.starts_with_insensitive("no")) { - EnableFeature = false; - Name = Name.substr(2); - } + bool EnableFeature = !Name.consume_front_insensitive("no"); bool FoundExtension = false; for (const auto &Extension : ExtensionMap) { |
