aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2022-12-20 18:04:53 -0500
committerLouis Dionne <ldionne.2@gmail.com>2022-12-20 19:56:28 -0500
commit52aab0e4b4a5d6728f4bb9c7b3340133f585fc15 (patch)
treedadc42b681ce03cc9f9f453b7d53654a899afbc0 /clang/lib/CodeGen/CodeGenFunction.cpp
parent8840891debf196d63b531b69fbb65138ecd50d02 (diff)
downloadllvm-52aab0e4b4a5d6728f4bb9c7b3340133f585fc15.zip
llvm-52aab0e4b4a5d6728f4bb9c7b3340133f585fc15.tar.gz
llvm-52aab0e4b4a5d6728f4bb9c7b3340133f585fc15.tar.bz2
[clang] Re-apply change to avoid passing -stdlib=libc++ spuriously to CC1 on Darwin
Previously, we would be passing down -stdlib=libc++ from the Driver to CC1 whenever the default standard library on the platform was libc++, even if -stdlib= had not been passed to the Driver. This meant that we would pass -stdlib=libc++ in nonsensical circumstances, such as when compiling C code. This logic had been added in b534ce46bd40 to make sure that header search paths were set up properly. However, since libc++ is now the default Standard Library on Darwin, passing this explicitly is not required anymore. Indeed, if no -stdlib= is specified, CC1 will end up using libc++ if it queries which standard library to use, without having to be told. Not passing -stdlib= at all to CC1 on Darwin should become possible once CC1 stops relying on it to set up framework search paths. Furthermore, this commit also removes a diagnostic checking whether the deployment target is too old to support libc++. Nowadays, all supported deployment targets use libc++ and compiling with libstdc++ is not supported anymore. The Driver was the wrong place to issue this diagnostic since it doesn't know whether libc++ will actually be linked against (e.g. C vs C++), which would lead to spurious diagnostics. Given that these targets are not supported anymore, we simply drop the diagnostic instead of trying to refactor it into CC1. This is a re-application of 6540f32db09c which had been reverted in 49dd02bd0819 because it broke a compiler-rt test. The test had broken because we were compiling C code and passing -stdlib=libc++, which Clang will now warn about. rdar://103198514 Differential Revision: https://reviews.llvm.org/D139938
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions