[mips] On error, ParseDirective should always return false to signify that the
directive was understood.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM with a few small changes.
Could you format this the way clang-format would? In particular there should be a space after the '//' in comments and before the '{' on the if-statements.
Could you also add a test case? Something that checks we don't emit the 'unknown directive' error for one of the incorrect directives is sufficient.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
4884 ↗ | (On Diff #56186) | If they're going to have the same name then I agree that they should be consistent in behaviour. From their usage it looks like we ought to have both behaviours available so I think it's best to rename one of them. We should leave that for another patch though. |
6039–6041 ↗ | (On Diff #56186) | I disagree with this comment as it's written since most errors are reported because we didn't (fully) understand the directive. However, the caller of ParseDirective() phrases it as "It will return 'true' if it isn't interested in this directive." which I read as "it recognized the first token of the directive and decided to handle it". I think this is what you mean and I agree we don't comply with this at the moment. I'm thinking it might be better phrased as something like:
|
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
4884 ↗ | (On Diff #56186) | Either that or merge them into a single. Regardless, I've added a bit more text to be a bit clearer. |