This is an archive of the discontinued LLVM Phabricator instance.

[Preamble] Check system dependencies in preamble too
ClosedPublic

Authored by ilya-biryukov on Jul 4 2018, 10:19 AM.

Details

Summary

PrecompiledPreamble hasn't checked the system dependencies changed
before. This result in invalid preamble not being rebuilt if headers
that changed were found in -isystem include paths.

This pattern is sometimes used to avoid showing warnings in third
party code, so we want to correctly handle those cases.

Tested in clangd, see the follow-up patch.

Diff Detail

Repository
rL LLVM

Event Timeline

ilya-biryukov created this revision.Jul 4 2018, 10:19 AM
sammccall accepted this revision.Jul 5 2018, 1:04 AM

This seems like it might be a nontrivial performance hit (it's going to result in stating all these files, right?).
Agreed it's important for correctness, it's possible someone wants the performance/correctness tradeoff though.

lib/Frontend/PrecompiledPreamble.cpp
71 ↗(On Diff #154134)

avoid errors --> suppress warnings?

This revision is now accepted and ready to land.Jul 5 2018, 1:04 AM
ilya-biryukov marked an inline comment as done.
  • Fix a comment

This seems like it might be a nontrivial performance hit (it's going to result in stating all these files, right?).
Agreed it's important for correctness, it's possible someone wants the performance/correctness tradeoff though.

I do agree that it's (probably) useless to stat the STL in /usr/lib for most of the users, maybe in some other cases too. Happy to add an option if that turns out to be a problem.

This revision was automatically updated to reflect the committed changes.