[RISCV] Refactor parseVTypeI and use ParseFail if we parsed more than one identifier.
Previously we lexed into a SmallVector and unlexed the tokens if the parsing failed. This patch gets rid of the SmallVector and the unlexing. If the first token fails to parse, return MatchFail. This allows us to fallback to parsing as an immediate. If we successfully parsed the first token, use ParseFail if any later tokens fail to parse. This avoids needing to UnLex the tokens. I've used a state machine to keep track of what component we've parsed so far. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D150753
Loading
Please sign in to comment