Skip to content

Commit 28ce7d8

Browse files
[ARM] Change the type of CC code in splitMnemonic.
This changes the type from `unsigned` to `ARMCC::CondCodes` for clarity and correctness.
1 parent fb3e4e7 commit 28ce7d8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,10 @@ class ARMAsmParser : public MCTargetAsmParser {
506506

507507
bool isMnemonicVPTPredicable(StringRef Mnemonic, StringRef ExtraToken);
508508
StringRef splitMnemonic(StringRef Mnemonic, StringRef ExtraToken,
509-
unsigned &PredicationCode,
510-
unsigned &VPTPredicationCode, bool &CarrySetting,
511-
unsigned &ProcessorIMod, StringRef &ITMask);
509+
ARMCC::CondCodes &PredicationCode,
510+
ARMVCC::VPTCodes &VPTPredicationCode,
511+
bool &CarrySetting, unsigned &ProcessorIMod,
512+
StringRef &ITMask);
512513
void getMnemonicAcceptInfo(StringRef Mnemonic, StringRef ExtraToken,
513514
StringRef FullInst, bool &CanAcceptCarrySet,
514515
bool &CanAcceptPredicationCode,
@@ -6283,10 +6284,9 @@ bool ARMAsmParser::parsePrefix(ARMMCExpr::VariantKind &RefKind) {
62836284
//
62846285
// FIXME: Would be nice to autogen this.
62856286
// FIXME: This is a bit of a maze of special cases.
6286-
StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
6287-
StringRef ExtraToken,
6288-
unsigned &PredicationCode,
6289-
unsigned &VPTPredicationCode,
6287+
StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic, StringRef ExtraToken,
6288+
ARMCC::CondCodes &PredicationCode,
6289+
ARMVCC::VPTCodes &VPTPredicationCode,
62906290
bool &CarrySetting,
62916291
unsigned &ProcessorIMod,
62926292
StringRef &ITMask) {
@@ -6340,7 +6340,7 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
63406340
unsigned CC = ARMCondCodeFromString(Mnemonic.substr(Mnemonic.size()-2));
63416341
if (CC != ~0U) {
63426342
Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 2);
6343-
PredicationCode = CC;
6343+
PredicationCode = (ARMCC::CondCodes)CC;
63446344
}
63456345
}
63466346

@@ -6387,7 +6387,7 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
63876387
unsigned CC = ARMVectorCondCodeFromString(Mnemonic.substr(Mnemonic.size()-1));
63886388
if (CC != ~0U) {
63896389
Mnemonic = Mnemonic.slice(0, Mnemonic.size()-1);
6390-
VPTPredicationCode = CC;
6390+
VPTPredicationCode = (ARMVCC::VPTCodes)CC;
63916391
}
63926392
return Mnemonic;
63936393
}

0 commit comments

Comments
 (0)