These flags toggle the addition of the nousejumptable function
attribute introduced in D18321.
Details
Diff Detail
Event Timeline
Hrm. So it can be changed in the future do we want it to be a string attribute similar to use-soft-float rather than a hard coded one? (I think the answer is "probably")
-eric
Besides a few nits, this looks good as far as I can tell. Eric should probably sign off on it, though.
include/clang/Driver/Options.td | ||
---|---|---|
590 | It's not just the size of the switch, but also the density, etc. I think it would make more sense to add HelpText to the -fno flag below instead. How about: "Do not use jump tables for lowering switches" | |
lib/CodeGen/CodeGenFunction.cpp | ||
715 | nit: period at the end of comment, and 80+ column line | |
test/CodeGen/nousejumptable.c | ||
4 | ultra nit: there's usually a space between the // and CHECK | |
7 | Is there a need for volatile here? Otherwise, drop it. |
Change help message and update nojumptable test for new string attribute
include/clang/Driver/Options.td | ||
---|---|---|
590 | This is help message for from GCC, but I agree this is clearer |
test/CodeGen/nousejumptable.c | ||
---|---|---|
44 | The only thing this test does is checking for the attribute. All the code is useless. You can have a single function define void @foo() { ret void } And it should be enough to check that the attribute is added |
It's not just the size of the switch, but also the density, etc.
I think it would make more sense to add HelpText to the -fno flag below instead. How about:
"Do not use jump tables for lowering switches"