[Driver] Make clang/cc conforms to UNIX standard
authorSteven Wu <stevenwu@apple.com>
Fri, 10 Nov 2017 01:32:47 +0000 (01:32 +0000)
committerSteven Wu <stevenwu@apple.com>
Fri, 10 Nov 2017 01:32:47 +0000 (01:32 +0000)
commit9278019eb34f787b92b26d44e1b1a1458b29a29b
treef2db7de034328acb2bd454714ed5407f559692a8
parent07d9f10374332d945011e7f7643823d8de88a0cd
[Driver] Make clang/cc conforms to UNIX standard

Summary:
This is basically reverting r261774 with a tweak for clang-cl. UNIX
standard states:
When c99 encounters a compilation error that causes an object file not
to be created, it shall write a diagnostic to standard error and
continue to compile other source code operands, but it shall not perform
the link phase and it shall return a non-zero exit status

The same goes for c89 or cc. And they are all alias or shims pointing to
clang on Darwin.

The original commit was intended for CUDA so the error message doesn't
get emit twice for both host and device. It seems that the clang driver
has been changed to model the CUDA dependency differently. Now the
driver behaves the same without this commit.

rdar://problem/32223263

Reviewers: thakis, dexonsmith, tra

Reviewed By: tra

Subscribers: jlebar, cfe-commits

Differential Revision: https://reviews.llvm.org/D39502

llvm-svn: 317860
clang/lib/Driver/Compilation.cpp
clang/test/Driver/cuda-bail-out.cu [new file with mode: 0644]
clang/test/Driver/output-file-cleanup.c
clang/test/Driver/unix-conformance.c [new file with mode: 0644]