[PATCH] D137043: [clang] add implicit include for Linux/gnu compatibility
Aaron Puchert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 20 15:10:12 PST 2022
aaronpuchert added a comment.
In D137043#3935526 <https://reviews.llvm.org/D137043#3935526>, @Origami404 wrote:
> In D137043#3935129 <https://reviews.llvm.org/D137043#3935129>, @aaronpuchert wrote:
>
>> This include-if-exists mechanism seems brittle to me.
>
> Do you mean the way that we used to test a file and include it (inserting `#if __has_include`) is brittle or compilation flags like `--include-if-exists` themselves are?
The mechanism itself. For example, we might include the file even if it doesn't belong to the C library implementation that we want to use, just because it's there.
>> Can we not make it dependent on the triple, i.e. include the file if we're using a libc implementation that's known to provide (and require) this file?
>
> I am afarid that without depending on triples, we are not able to distinguish what environment we are in or libc we use. Can you explain more about this?
I was suggesting to have it depend on the triple, not be independent of it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137043/new/
https://reviews.llvm.org/D137043
More information about the cfe-commits
mailing list