This is an archive of the discontinued LLVM Phabricator instance.

[mips] Added support for -Wa,-mips32 and similar.
ClosedPublic

Authored by s.egerton on Nov 30 2015, 2:15 AM.

Diff Detail

Event Timeline

s.egerton updated this revision to Diff 41375.Nov 30 2015, 2:15 AM
s.egerton retitled this revision from to [mips] Added support for -Wa,-mips32 and similar..
s.egerton updated this object.
s.egerton added reviewers: dsanders, vkalintiris.
s.egerton added a subscriber: cfe-commits.
dsanders requested changes to this revision.Dec 16 2015, 6:33 AM
dsanders edited edge metadata.
dsanders added inline comments.
lib/Driver/Tools.cpp
2501–2524

We don't quite do the right thing when we get multiple -mips* options. For -Wa,-mips64r2,-mips4 we don't undo the effect of the '-target-feature +mips64r2' when we process the -mips4. As a result, the selected target is mips64r2 whereas GAS would select mips4.

We can't fix this by adding a '-target-feature -mips64r2' since would select mips64 so we'll need to wait until we've seen all the '-Wa,' arguments before we add the -target-feature (similar to --compress-debug-sections).

2506–2507

There should be a mips5 case too.

test/Driver/mips-ias-Wa.s
66–74

There should be a mips5 case too

121–129

These two tests aren't quite right since the selected target is the maximum of the three at the moment.

This revision now requires changes to proceed.Dec 16 2015, 6:33 AM
s.egerton updated this revision to Diff 43131.Dec 17 2015, 6:48 AM
s.egerton edited edge metadata.
s.egerton marked 4 inline comments as done.

Responded to reviewers comments.

The -mips* option is now saved until all arguments have been parsed. The last -mips* option is the only one pushed back.
The tests are now updated to check that multiple -target-feature -mips* options are not present.

dsanders accepted this revision.Dec 18 2015, 3:28 AM
dsanders edited edge metadata.

With a couple small changes it will LGTM

lib/Driver/Tools.cpp
2572–2573

It would be better to use a null pointer check and use nullptr instead of the empty strings in the initial and default cases.

test/Driver/mips-ias-Wa.s
121–129

You need to check the CHECK-NOT's on both sides of the CHECK.

This revision is now accepted and ready to land.Dec 18 2015, 3:28 AM
s.egerton closed this revision.Jan 13 2016, 6:31 AM
s.egerton marked 2 inline comments as done.