This is an archive of the discontinued LLVM Phabricator instance.

GCC compatibility: Create a Group to ignore unsupported optimization
ClosedPublic

Authored by bubbles231 on Jul 10 2014, 6:24 AM.

Details

Summary

This patch creates a group that will ignore unsupported optimizations and give the user a warning. This patch includes -finline-limit as one of those ignored flags.

Diff Detail

Event Timeline

bubbles231 updated this revision to Diff 11267.Jul 10 2014, 6:24 AM
bubbles231 retitled this revision from to GCC compatibility: Create a Group to ignore unsupported optimization.
bubbles231 updated this object.
bubbles231 edited the test plan for this revision. (Show Details)
include/clang/Basic/DiagnosticDriverKinds.td
122

Please add quote '%0'

test/Driver/clang_f_opts.c
162

I think we should update the test to check that the warning is displayed.

Fixed make test error and added '%0' as requested.

rnk accepted this revision.Jul 10 2014, 2:46 PM
rnk edited edge metadata.

This seems like the right direction, feel free to commit with some minor fixes.

include/clang/Basic/DiagnosticDriverKinds.td
122

None of our diagnostics start with a leading capital letter, so I would try to be consistent with that.

include/clang/Driver/Options.td
92

wrap before the "

1567

this looks like a good candidate for the group, I'm sure there's more

lib/Driver/Tools.cpp
3132

needs wrapping

This revision is now accepted and ready to land.Jul 10 2014, 2:46 PM

Thanks for the feedback. I will make those changes. I just have one
question:

this looks like a good candidate for the group, I'm sure >there's more

Should I replace all clang_ignored_f_Group?
If so can I remove that group?
If not how do I know which ones to change?

rnk added a comment.Jul 10 2014, 4:57 PM

Not everything in clang_ignored_f_Group is an optimization flag, so no, I'd
leave the rest of them alone. I believe -ivopts is an optimization flag,
so it would be appropriate to put in this group.

Thanks for clearing that up. I will add the optimization flags in another
review.

bubbles231 updated this revision to Diff 11312.Jul 11 2014, 3:09 AM
bubbles231 edited edge metadata.

Add tests for the warning and small fixes from comments.

sylvestre.ledru edited edge metadata.

Merged as commit r212805
Congratulation to Arthur for his first patch!