Skip to content

Commit

Permalink
[clang-scan-deps] use -Wno-error when scanning for dependencies
Browse files Browse the repository at this point in the history
Warnings can be promoted to errors.
But that shouldn't prevent us from getting the dependencies!

Differential Revision: https://reviews.llvm.org/D64149

llvm-svn: 365065
  • Loading branch information
hyp committed Jul 3, 2019
1 parent b853fa6 commit 2d57e7d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clang/test/ClangScanDeps/Inputs/no-werror.json
@@ -0,0 +1,7 @@
[
{
"directory": "DIR",
"command": "clang -E DIR/no-werror.cpp -IInputs -std=c++17 -Weverything -Werror",
"file": "DIR/no-werror.cpp"
}
]
1 change: 1 addition & 0 deletions clang/test/ClangScanDeps/Inputs/sys-header.h
@@ -0,0 +1 @@
#define MACRO 201411
16 changes: 16 additions & 0 deletions clang/test/ClangScanDeps/no-werror.cpp
@@ -0,0 +1,16 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/no-werror.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/sys-header.h %t.dir/Inputs/sys-header.h
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/no-werror.json > %t.cdb
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | FileCheck %s

#define MACRO 201411L

#include "sys-header.h"

// CHECK: no-werror.cpp
// CHECK-NEXT: Inputs{{/|\\}}sys-header.h
1 change: 1 addition & 0 deletions clang/tools/clang-scan-deps/ClangScanDeps.cpp
Expand Up @@ -129,6 +129,7 @@ int main(int argc, const char **argv) {
AdjustedArgs.push_back("-Eonly");
AdjustedArgs.push_back("-Xclang");
AdjustedArgs.push_back("-sys-header-deps");
AdjustedArgs.push_back("-Wno-error");
return AdjustedArgs;
});

Expand Down

0 comments on commit 2d57e7d

Please sign in to comment.