Adjust sanity check in register parsing function to allow register name with more than 2 characters (e.g. ccr).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp | ||
---|---|---|
489 | It might be simpler to pull out CCR for now. Otherwise this will cause some invalid register names to be parsed as valid %a0q for example would be parsed as A0 (the third character would be ignored). A better solution might be to remove this check and in the switch cases check the name length. I recognise this is due to my error! |
llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp | ||
---|---|---|
489 | Good point. Will do. |
LGTM
llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp | ||
---|---|---|
489 | Agreed. I expected some changes to the register name parsing to be necessary. 😄 |
llvm/test/MC/M68k/Data/Classes/MxMoveCCR.s | ||
---|---|---|
1–16 | Keep your tests minimal please, no unnecessary crud |
llvm/test/MC/M68k/Data/Classes/MxMoveCCR.s | ||
---|---|---|
1–16 |
It might be simpler to pull out CCR for now. Otherwise this will cause some invalid register names to be parsed as valid %a0q for example would be parsed as A0 (the third character would be ignored).
A better solution might be to remove this check and in the switch cases check the name length.
I recognise this is due to my error!