Use the llvm command line handling.

Instead of copy&paste code, use instead the functions provided by llvm.
Also added a test to check that the flag "warning as errors" works.

Change-Id: I8c00d8385bcfb4ad9d0bc559cdb6343aac780406
4 files changed