[PATCH] D64149: [clang-scan-deps] use `-Wno-error` when scanning for dependencies

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 3 11:02:54 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL365065: [clang-scan-deps] use `-Wno-error` when scanning for dependencies (authored by arphaman, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64149?vs=207844&id=207847#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64149/new/

https://reviews.llvm.org/D64149

Files:
  cfe/trunk/test/ClangScanDeps/Inputs/no-werror.json
  cfe/trunk/test/ClangScanDeps/Inputs/sys-header.h
  cfe/trunk/test/ClangScanDeps/no-werror.cpp
  cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp


Index: cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp
===================================================================
--- cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp
+++ cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -129,6 +129,7 @@
         AdjustedArgs.push_back("-Eonly");
         AdjustedArgs.push_back("-Xclang");
         AdjustedArgs.push_back("-sys-header-deps");
+        AdjustedArgs.push_back("-Wno-error");
         return AdjustedArgs;
       });
 
Index: cfe/trunk/test/ClangScanDeps/no-werror.cpp
===================================================================
--- cfe/trunk/test/ClangScanDeps/no-werror.cpp
+++ cfe/trunk/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
Index: cfe/trunk/test/ClangScanDeps/Inputs/sys-header.h
===================================================================
--- cfe/trunk/test/ClangScanDeps/Inputs/sys-header.h
+++ cfe/trunk/test/ClangScanDeps/Inputs/sys-header.h
@@ -0,0 +1 @@
+#define MACRO 201411
Index: cfe/trunk/test/ClangScanDeps/Inputs/no-werror.json
===================================================================
--- cfe/trunk/test/ClangScanDeps/Inputs/no-werror.json
+++ cfe/trunk/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"
+}
+]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64149.207847.patch
Type: text/x-patch
Size: 1847 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190703/6b93772e/attachment-0001.bin>


More information about the cfe-commits mailing list