Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tooling] Allow -flto flags and filter out -Wa, flags
This change fixes the problem in https://bugs.llvm.org/show_bug.cgi?id=38332 by allowing driver::Action::BackendJobClass to run with the analyzer. Otherwise, such jobs will look up the non-existing compilation database and then run without flags. Also filter out the -Wa,* flags that could be passed to and ignored by the clang compiler. Clang-tidy gives warnings about unused -Wa,* flags. Differential Revision: http://reviews.llvm.org/D51002 llvm-svn: 340421
- Loading branch information
Showing
2 changed files
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// RUN: clang-check -analyze "%s" -- -c 2>&1 | FileCheck %s | ||
// RUN: clang-check -analyze "%s" -- -c -flto -Wa,--noexecstack 2>&1 | FileCheck %s | ||
// RUN: clang-check -analyze "%s" -- -c -no-integrated-as -flto=thin 2>&1 | FileCheck %s | ||
// RUN: clang-check -analyze "%s" -- -c -flto=full 2>&1 | FileCheck %s | ||
|
||
// CHECK: Dereference of null pointer | ||
void a(int *x) { if(x){} *x = 47; } |