[PATCH] D55150: Emit warnings from the driver for use of -mllvm or -Xclang options.

James Y Knight via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 6 11:17:51 PST 2018


jyknight added a comment.

In D55150#1321759 <https://reviews.llvm.org/D55150#1321759>, @george.karpenkov wrote:

> Using `-Xclang` is the only way to pass options to the static analyzer, I don't think we should warn on it.


Well,, that seems unfortunate if we have the only supported interface for the static analyzer be an internal interface. Perhaps it can be given a different option? Even discounting this change, I that seems like it would be appropriate.

In D55150#1321771 <https://reviews.llvm.org/D55150#1321771>, @arphaman wrote:

> Swift uses `-Xclang` to pass in build settings to its own build and to pass in custom options through its Clang importer that we intentionally don't want to expose to Clang's users. We don't want to warn for those uses for sure.


I'm not sure if I understand correctly, so I'll try to reiterate: Swift calls clang internally, and when it does so, intentionally uses options that are not generally intended for others to use. Of course we shouldn't emit warnings in that case.

Is that a correct understanding? If so, doesn't it just make sense for that constructed command-line to disable the warning? And, isn't it good that it will warn, otherwise, in order to discourage people from using those flags that are intentionally-not-exposed?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55150/new/

https://reviews.llvm.org/D55150





More information about the cfe-commits mailing list