Currently scan-build cannot pass target triple information to clang.
It makes analysis failure when build script has target specific compiler flags.
This patch adds --analyzer-target option to support analysis for other targets.
--analyzer-target [target triple name for analysis] --analyzer-target=[target triple name for analysis] This provides target triple information to clang static analyzer. It only changes the target for analysis and doesn't change the target of a real compiler given by --use-cc and --use-c++ options.
This is the only real documentation provided to the user to understand what this option does. It is a completely optional option, and I feel it needs a bit more clarification. Perhaps just a second sentence to say "use this when you want to analyze for a different architecture than the default". Also, it isn't clear to the user if this effects both static analysis and compilation, or just compilation. For example, is the expectation that compilation gets the normal flags without this trip, and that static analysis gets this triple?
There's also many cases where this flag won't work. Instead of having a specific flag for target triple, maybe just an "extra flags to pass to the compiler" would be sufficient (and more general).