[PATCH] D43871: [modules] No longer include stdlib.h from mm_malloc.h.

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 11 10:45:31 PST 2018


teemperor added a comment.

@joerg Yeah, we saw the commit explaining why the original fwd declaration patch was reverted. However, from what I can see, we only have three ways to fix the cyclic dependency between glibc and Clang's internal module:

1. We say that we don't support including mm_malloc.h from the module containing stdlib.h.
2. We don't include mm_malloc.h (and the internal headers that include mm_malloc.h) in Clang's internal module.
3. We add this workaround to allow us to forward declare free/malloc here.

Solution 1 essentially means that we won't support a glibc with modules until they work around this issue. And solution 2 means that all affected headers in clang's internal module have to be textually copied into modules that include them.

So after some offline discussion on how to proceed with this, the plan we came up with was to land this patch (which implements solution 3) and then see how/if we can work around the problems that users experience because of it (otherwise we would revert).

I don't have a strict preference between solution 2 and 3 at this point. So if @joerg thinks that this approach is not the right one, then I would just make a new patch that removes the affected headers from Clang's internal module.


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

https://reviews.llvm.org/D43871





More information about the cfe-commits mailing list