This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add warning when `-include-pch` is passed multiple times
AbandonedPublic

Authored by keith on Nov 2 2020, 1:53 PM.

Details

Reviewers
jansvoboda11
Summary

Previously this argument passed multiple times would result in the first
being silently ignored.

Diff Detail

Event Timeline

keith created this revision.Nov 2 2020, 1:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2020, 1:53 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
keith requested review of this revision.Nov 2 2020, 1:53 PM
keith updated this revision to Diff 319138.Jan 25 2021, 3:11 PM

Add group to warning

There are many options whether the latter one overrides the previous ones. How is this special?

keith added a comment.Jan 25 2021, 3:19 PM

Fair question! I think this case is a bit different since it's quite subtle. The strange thing here is that the header you're intending to provide a pch for can still be read successfully, but not getting the benefits of the pch that you were expecting without knowing about it.

Is there any reason that -include-pch shouldn't follow the precedent of -include, which can be used multiple times? If not, then the end goal should be to support multiple uses, but in the mean time a warning is helpful.

keith added a comment.Feb 9 2021, 9:34 AM

Yea seems like a reasonable request, looking through the uses nothing immediately pops out as being not supporting multiple PCHs but I guess before I went down that path I'd want someone who knew the code better to agree on that

jansvoboda11 resigned from this revision.Mar 5 2021, 1:30 AM
keith abandoned this revision.Oct 11 2021, 2:15 PM