]> granicus.if.org Git - clang/commit
[driver] Parse diagnostic args in the driver.
authorChad Rosier <mcrosier@apple.com>
Tue, 13 Mar 2012 20:09:56 +0000 (20:09 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 13 Mar 2012 20:09:56 +0000 (20:09 +0000)
commit2dec85b21822f950bf6035640c496ad835e11728
tree6feb366bf192bf25d6a4ca2244e7e5d318722bc6
parentb990d039c7e01ad0055dcbd1e13a691813397b96
[driver] Parse diagnostic args in the driver.

Previously, only diagnostics thrown by the cc1 process were
actually honoring the diagnostic options given on the command line,
like -Werror.

Reuse the existing code in Frontend currently used for cc1,
adjusting it to not interpret -Wl, linker flags as warnings.

Also fix a faulty test exposed by this change.
It wasn't actually testing anything, and was giving this warning:

clang-3: warning: argument unused during compilation: '-verify'

Which -Werror didn't turn into an error because it was output
by the driver, not the cc1 process, and diagnostic options
weren't parsed by the driver. And you couldn't see the warning
when running the test suite.

Fixes PR12181.
Patch by Dylan Noblesmith <nobled@dreamwidth.org>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152660 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/ArgList.h
include/clang/Frontend/CompilerInvocation.h
lib/Driver/ArgList.cpp
lib/Frontend/CompilerInvocation.cpp
test/Driver/diagnostics.c [new file with mode: 0644]
test/Driver/no-objc-arr.m
tools/driver/driver.cpp