I found that clang has -fsplit-stack but doesn't support -fno-split-stack. So I think it is natural to support it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Adding the negative option to the driver makes sense to me. I think we could also simplify the option definitions, see my inline comment.
clang/include/clang/Driver/Options.td | ||
---|---|---|
2381 | Typo. I think it would also make sense to merge the option definitions for driver (fsplit_stack and fno_split_stack) and CC1 (split_stacks) into one. (We can rename the CC1 option from -split-stacks to -fsplit-stack.) Other options already do this via BoolFOption, for example signed_char above. If you are not sure about how that works, take a look here. |
clang/include/clang/Driver/Options.td | ||
---|---|---|
2381 | Thanks for reviewing. For the renaming part, I worry about if it involves problems for compatibility. If we mark fsplit_stack as BoolFOption, the user seems couldn't specify the opposite value by -fno-split-stack which seems to be one traditional usage style. |
clang/include/clang/Driver/Options.td | ||
---|---|---|
2381 | Why not? BoolFOption would create both -fsplit-stack and -fno-split-stack in the driver. Marking the former with CC1Option would make it available to CC1 as well and we get the same result as with your current changes (but unifying the wording and tablegen definitions). |
clang/include/clang/Driver/Options.td | ||
---|---|---|
2381 | Thanks for clarifying. I am not clear about the driver part. And I worry about if it is a problem if we rename the CC1 option from -split-stacks to -fsplit-stack. |
clang/include/clang/Driver/Options.td | ||
---|---|---|
2381 | What are you not clear about on the driver part? Renaming CC1 options is fine, as they are only intended to be used by Clang developers and we don't need to keep them backward compatible. Fixing potential build failures should be all there is to it. |
Merge -fsplit-stack and -fno-split-stack into one in options.td. And rename -split-stacks into -fsplit-stack.
clang/include/clang/Driver/Options.td | ||
---|---|---|
2381 | Thanks for clarifying! |
If we want to improve test coverage, we can test -fno-split-stack -fsplit-stack passes -fsplit-stack. But doing this for every option may be excessive...
I have filed the libgcc morestack.S .init_array.0 feature request: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99759
clang/include/clang/Driver/Options.td | ||
---|---|---|
2383 | s/Would use/Use/ |
Typo.
I think it would also make sense to merge the option definitions for driver (fsplit_stack and fno_split_stack) and CC1 (split_stacks) into one. (We can rename the CC1 option from -split-stacks to -fsplit-stack.)
Other options already do this via BoolFOption, for example signed_char above. If you are not sure about how that works, take a look here.