This is an archive of the discontinued LLVM Phabricator instance.

[mips] Implement .ent, .end, .frame, .mask and .fmask.
ClosedPublic

Authored by tomatabacu on Jun 17 2014, 9:21 AM.

Diff Detail

Event Timeline

matheusalmeida retitled this revision from to [mips] Implement .ent, .end, .frame, .mask and .fmask..
matheusalmeida updated this object.
matheusalmeida edited the test plan for this revision. (Show Details)

Add missing early return.

matheusalmeida edited the test plan for this revision. (Show Details)Jun 18 2014, 2:55 AM
matheusalmeida added reviewers: vmedic, dsanders.
tomatabacu commandeered this revision.Jul 18 2014, 6:36 AM
tomatabacu added a reviewer: matheusalmeida.
tomatabacu added a subscriber: tomatabacu.

Commandeered to finish off the patch and make it ready for commit.

tomatabacu updated this revision to Diff 11641.Jul 18 2014, 6:37 AM

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.

dsanders edited edge metadata.Aug 7 2014, 8:04 AM

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.

3056–3059

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.

3086

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
490–496

OS.EmitIntValue(GPRInfoSet ? GPRBitMask : 0, 4) would be a bit cleaner.

570

Identifiers begining with underscore followed by a capital letter are reserved by the C++ standard. Could you put the underscore at the end?

tomatabacu updated this revision to Diff 12308.EditedAug 8 2014, 9:09 AM
tomatabacu edited edge metadata.

Addressed comments.
Improved parsing of the .ent extension.
Improved the mips-pdr-bad test.
Ran clang-format and rebased.

tomatabacu updated this revision to Diff 12309.Aug 8 2014, 9:28 AM

Removed unrelated changes.

dsanders accepted this revision.Aug 11 2014, 3:05 AM
dsanders edited edge metadata.

Thanks. Just a couple nits and then it will LGTM.

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
71

You missed this instance of NULL.

2955–2956

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.
2964

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.
This revision is now accepted and ready to land.Aug 11 2014, 3:05 AM
tomatabacu updated this revision to Diff 12344.Aug 11 2014, 5:58 AM
tomatabacu edited edge metadata.

Addressed comments.

dsanders added inline comments.Aug 11 2014, 6:54 AM
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
2958

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.

tomatabacu updated this revision to Diff 12345.Aug 11 2014, 7:19 AM

Addressed comments.

dsanders closed this revision.Aug 11 2014, 8:37 AM