Page MenuHomePhabricator

Move f optimizations to clang_ignored_gcc_optimization_f_Group
ClosedPublic

Authored by bubbles231 on Jul 11 2014, 8:55 AM.

Details

Summary

Moved 25 flags to clang_ignored_gcc_optimization_f_Group. Will display a warning to the user if they try to pass those optimizations.

Patch by Arthur Marble <arthur@info9.net> in the context of Debian Google Summer of code 2014.

Diff Detail

Event Timeline

bubbles231 updated this revision to Diff 11320.Jul 11 2014, 8:55 AM
bubbles231 retitled this revision from to Move f optimizations to clang_ignored_gcc_optimization_f_Group.
bubbles231 updated this object.
bubbles231 edited the test plan for this revision. (Show Details)
sylvestre.ledru added inline comments.
include/clang/Driver/Options.td
478–479

This one too

1613–1614

For other reviewers, it is an optim flag.

sylvestre.ledru updated this object.
sylvestre.ledru added a subscriber: Unknown Object (MLST).
bubbles231 updated this revision to Diff 11330.Jul 11 2014, 2:37 PM

Add -fdefer-pop to the group and update the code so it applies with new revisions.

bubbles231 updated this revision to Diff 11441.Jul 15 2014, 7:15 AM

Update patch to be compatible with new revision.

rnk added inline comments.Jul 15 2014, 1:19 PM
include/clang/Driver/Options.td
573–574

This isn't an optimization flag, IMO. This is the equivalent of changing all discardable (linkonce / linkonce_odr) globals to non-discardable globals (weak / weak_odr). I know it's in GCC optimization flag docs, but it's more of a correctness workaround for invalid code.

687–688

ditto, not optimization.

Actually, while you're at it, can you make this a BooleanFFlag to reduce duplication?

1585–1587

Hm, these are probably easy to implement in LLVM today. No action needed, though, this change is right.

test/Driver/clang_f_opts.c
172–173

These are lots of subprocess invocations. You can speed up the test significantly by making this all one compiler invocation along the lines of:

// RUN: %clang -### %s \
// RUN:  -fflag \
// ...
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
// CHECK-WARNING-DAG: optimization flag '-fflag' is not supported
// ...
bubbles231 updated this revision to Diff 11477.Jul 15 2014, 4:25 PM

Make requested changes.

sylvestre.ledru accepted this revision.Jul 17 2014, 4:40 AM
sylvestre.ledru edited edge metadata.

rnk, is it ok with you too?

This revision is now accepted and ready to land.Jul 17 2014, 4:40 AM

Merged by Arthur on my request as commit r213365 to make sure it gets in 3.5.
rnk, don't hesitate to drop us a mail if you see anything wrong.