This is an archive of the discontinued LLVM Phabricator instance.

Add -target option when clang is invoked to check syntax
Needs ReviewPublic

Authored by kazuhiro.yabe on May 8 2017, 12:06 AM.

Details

Reviewers
krememek
Summary

Dear all,

This patch adds the '-target' option to the clang option to invoke to
check the syntax when scan-build is called with the --analyzer-target
option.

I'm using scan-build in cross compile project. (target: armv7-a)
Even when cross compiling, scan-build invokes clang with -triple (HOST
ARCH) to check syntax.
Therefore, if my code has some errors, clang reports error in syntax checking:

error: unknown target CPU 'armv7-a'

This patch fixes that issue.

Thanks.

Diff Detail