This is an archive of the discontinued LLVM Phabricator instance.

[clang][cli] Pass '-Wspir-compat' to cc1 from driver
ClosedPublic

Authored by jansvoboda11 on Feb 19 2021, 2:38 AM.

Details

Summary

This patch moves the creation of the '-Wspir-compat' argument from cc1 to the driver.

Without this change, generating command line arguments from CompilerInvocation cannot be done reliably: there's no way to distinguish whether '-Wspir-compat' was passed to cc1 on the command line (should be generated), or if it was created within CompilerInvocation::CreateFromArgs (should not be generated).

This is also in line with how other '-W' flags are handled.

(This was introduced in D21567.)

Diff Detail

Event Timeline

jansvoboda11 created this revision.Feb 19 2021, 2:38 AM
jansvoboda11 requested review of this revision.Feb 19 2021, 2:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2021, 2:38 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 edited the summary of this revision. (Show Details)
Anastasia added inline comments.Feb 19 2021, 5:23 AM
clang/lib/Driver/ToolChains/Clang.cpp
4267

It seems like this should have been in addClangWarningOptions but there is no toolchain for SPIR?

Could we add a FIXME at least saying that this deviates from the default flow right now?

Add FIXME

clang/lib/Driver/ToolChains/Clang.cpp
4267

That's right. I added the FIXME.

Anastasia accepted this revision.Feb 19 2021, 6:28 AM

LGTM! Thanks

This revision is now accepted and ready to land.Feb 19 2021, 6:28 AM
This revision was landed with ongoing or failed builds.Feb 22 2021, 12:55 AM
This revision was automatically updated to reflect the committed changes.