This is an archive of the discontinued LLVM Phabricator instance.

clang-cl: accept -f[no-]data-sections and -f[no-]function-sections
AbandonedPublic

Authored by inglorion on Jun 4 2020, 4:36 PM.

Details

Reviewers
hans
thakis
Summary

This adds -fdata-sections, -ffunction-sections, and their negations to
the list of -f options accepted by clang-cl. As a result, these
options can be used with the same spelling for both clang and
clang-cl.

Diff Detail

Event Timeline

inglorion created this revision.Jun 4 2020, 4:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2020, 4:36 PM
thakis added a comment.Jun 4 2020, 5:37 PM

The clang-cl spelling of this is /Gy and /Gw. If you want to use the gcc spelling, you can do that through the /clang: flag.

thakis requested changes to this revision.Jun 4 2020, 5:38 PM

In other words: The point of clang-cl is to use cl.exe flag spellings where they exist. So unless there's some good reason for adding this, I don't think we should add it.

This revision now requires changes to proceed.Jun 4 2020, 5:38 PM
inglorion abandoned this revision.Jun 5 2020, 3:17 PM

Ok, thanks for clarifying.

The benefit this would get us is not having to spell the flags differently depending on whether the frontend is clang or clang-cl. I figured this would fit in with all the -f options we already take and not really increase the risk of conflicting with future cl.exe options. But as you said, there are clang-cl options that will enable the exact same functionality, so I'll abandon this.