Details
Diff Detail
Event Timeline
Changed all uses of MCSymbol to StringRef for the ".end" directive.
Added initialization for CurrentFn in the constructor for MipsAsmParser.
Changed "00000702" to "00000802" in the ".rel.pdr" SectionData in the mips-pdr.s
test to reflect the addition of the ".MIPS.abiflags" section.
Rebased to trunk.
This patch looks like it's almost ready. There are just a few error messages that could be better, some error cases that will silently succeed, and a few style issues.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
71 | It's preferable to use nullptr instead of NULL. There are quite a few cases of this in the patch. | |
2736–2739 | Instead of eating any remaining tokens we should be testing that we have the end of the statement and reporting an error if we aren't. | |
2773 | Rather than just saying 'unexpected token' could you update the message to say what tokens it was expecting. Please also do this for the other cases added by this patch. | |
lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | ||
369–375 | OS.EmitIntValue(GPRInfoSet ? GPRBitMask : 0, 4) would be a bit cleaner. | |
450–457 | Identifiers begining with underscore followed by a capital letter are reserved by the C++ standard. Could you put the underscore at the end? |
Addressed comments.
Improved parsing of the .ent extension.
Improved the mips-pdr-bad test.
Ran clang-format and rebased.
Thanks. Just a couple nits and then it will LGTM.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
71 | You missed this instance of NULL. | |
2633–2634 | This explains what we are doing but doesn't explain why. I'd write something like: // Although we accept the undocumented extended version for compatibility reasons, // the additional argument has no functional effect so we'd like to discourage its use. // We therefore pretend that a comma is not accepted here when reporting errors. | |
2642 | I'd also mention it here with something like: // We want to discourage the use of this syntax but we shouldn't confuse the user when they've already tried to use it // We therefore admit to accepting it this time and tell the user what we expect. |
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
2636 | Nit: In this part of the code we haven't seen a comma. Instead we saw that the current token isn't a comma or an end-of-statement. |
It's preferable to use nullptr instead of NULL. There are quite a few cases of this in the patch.