These flags toggle the addition of the nousejumptable function
attribute introduced in D18321.
Details
Diff Detail
- Repository
- rL LLVM
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 ↗ | (On Diff #51790) | 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 ↗ | (On Diff #51790) | nit: period at the end of comment, and 80+ column line |
| test/CodeGen/nousejumptable.c | ||
| 3 ↗ | (On Diff #51790) | ultra nit: there's usually a space between the // and CHECK |
| 6 ↗ | (On Diff #51790) | 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 ↗ | (On Diff #51790) | This is help message for from GCC, but I agree this is clearer |
| test/CodeGen/nousejumptable.c | ||
|---|---|---|
| 43 ↗ | (On Diff #51915) | 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 |
LGTM
| include/clang/Frontend/CodeGenOptions.def | ||
|---|---|---|
| 152 ↗ | (On Diff #51925) | ultra nit: period at end of comment |