This is an archive of the discontinued LLVM Phabricator instance.

[clang] Always allow including builtin headers in [no_undeclared_headers] modules.
ClosedPublic

Authored by mboehme on May 29 2020, 1:49 AM.

Details

Reviewers
rsmith
Summary

Previously, this would fail if the builtin headers had been "claimed" by a different module that wraps these builtin headers. libc++ does this, for example.

This change adds a test demonstrating this situation; the test fails without the fix.

Diff Detail

Event Timeline

mboehme created this revision.May 29 2020, 1:49 AM

Temporarily retracting from review as I've realized there's another case I need to take care of.

mboehme removed a reviewer: rsmith.May 29 2020, 5:34 AM
mboehme updated this revision to Diff 267210.May 29 2020, 6:18 AM

When testing with the real libc++ and glibc, I realized that I was still getting a cyclic dependency between the two modules because the builtin stddef.h that glibc was including was still being ascribed to libc++.

This modified version fixes this and also updates the test to more closely reflect the real libc++ and glibc so that my previous version of the fix also fails with a cyclic dependency.

rsmith accepted this revision.Jun 3 2020, 10:33 AM
This revision is now accepted and ready to land.Jun 3 2020, 10:33 AM

Committed as https://github.com/llvm/llvm-project/commit/8d74de9de6d6cca552d7de7d0bfd36b6dd7d58dc.

I thought I had added a "Differential Revision:" to the commit message, but something must have gone wrong.

mboehme closed this revision.Jun 4 2020, 1:07 AM