[clang-tools-extra] r372601 - Revert "[clang-tidy] Fix relative path in header-filter."
Dmitri Gribenko via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 23 06:06:25 PDT 2019
Author: gribozavr
Date: Mon Sep 23 06:06:25 2019
New Revision: 372601
URL: http://llvm.org/viewvc/llvm-project?rev=372601&view=rev
Log:
Revert "[clang-tidy] Fix relative path in header-filter."
This reverts commit r372388. It made '-header-filter' inconsistent with
paths printed in diagnostics.
Removed:
clang-tools-extra/trunk/test/clang-tidy/Inputs/file-filter/subfolder_a/
clang-tools-extra/trunk/test/clang-tidy/Inputs/file-filter/subfolder_b/
clang-tools-extra/trunk/test/clang-tidy/Inputs/file-filter/subfolder_c/
Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/trunk/test/clang-tidy/file-filter.cpp
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp?rev=372601&r1=372600&r2=372601&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Mon Sep 23 06:06:25 2019
@@ -551,9 +551,7 @@ void ClangTidyDiagnosticConsumer::checkF
return;
}
- StringRef FileName = File->tryGetRealPathName();
- if (FileName.empty())
- FileName = File->getName();
+ StringRef FileName(File->getName());
LastErrorRelatesToUserCode = LastErrorRelatesToUserCode ||
Sources.isInMainFile(Location) ||
getHeaderFilter()->match(FileName);
Modified: clang-tools-extra/trunk/test/clang-tidy/file-filter.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/file-filter.cpp?rev=372601&r1=372600&r2=372601&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/file-filter.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/file-filter.cpp Mon Sep 23 06:06:25 2019
@@ -9,12 +9,6 @@
// file-filter\header*.h due to code order between '/' and '\\'.
// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -system-headers %s -- -I %S/Inputs/file-filter/system/.. -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK4 %s
// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -system-headers -quiet %s -- -I %S/Inputs/file-filter/system/.. -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK4-QUIET %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='subfolder_a' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK5 %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='subfolder_a' -quiet %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK5-QUIET %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='subfolder_b' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK6 %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='subfolder_b' -quiet %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK6-QUIET %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='subfolder_c' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK7 %s
-// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='subfolder_c' -quiet %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK7-QUIET %s
#include "header1.h"
// CHECK-NOT: warning:
@@ -25,12 +19,6 @@
// CHECK3-QUIET-NOT: warning:
// CHECK4: header1.h:1:12: warning: single-argument constructors
// CHECK4-QUIET: header1.h:1:12: warning: single-argument constructors
-// CHECK5-NOT: warning:
-// CHECK5-QUIET-NOT: warning:
-// CHECK6-NOT: warning:
-// CHECK6-QUIET-NOT: warning:
-// CHECK7-NOT: warning:
-// CHECK7-QUIET-NOT: warning:
#include "header2.h"
// CHECK-NOT: warning:
@@ -41,44 +29,6 @@
// CHECK3-QUIET: header2.h:1:12: warning: single-argument constructors
// CHECK4: header2.h:1:12: warning: single-argument constructors
// CHECK4-QUIET: header2.h:1:12: warning: single-argument constructors
-// CHECK5-NOT: warning:
-// CHECK5-QUIET-NOT: warning:
-// CHECK6-NOT: warning:
-// CHECK6-QUIET-NOT: warning:
-// CHECK7-NOT: warning:
-// CHECK7-QUIET-NOT: warning:
-
-#include "subfolder_a/header_a.h"
-// CHECK-NOT: warning:
-// CHECK-QUIET-NOT: warning:
-// CHECK2: header_b.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK2-QUIET: header_b.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK3-NOT: warning:
-// CHECK3-QUIET-NOT: warning:
-// CHECK4: header_b.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK4-QUIET: header_b.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK5: header_a.h:3:12: warning: single-argument constructors must be marked explicit
-// CHECK5-QUIET: header_a.h:3:12: warning: single-argument constructors must be marked explicit
-// CHECK6: header_b.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK6-QUIET: header_b.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK7-NOT: warning:
-// CHECK7-QUIET-NOT: warning:
-
-#include "subfolder_c/header_c.h"
-// CHECK-NOT: warning:
-// CHECK-QUIET-NOT: warning:
-// CHECK2: header_c.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK2-QUIET: header_c.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK3-NOT: warning:
-// CHECK3-QUIET-NOT: warning:
-// CHECK4: header_c.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK4-QUIET: header_c.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK5-NOT: warning:
-// CHECK5-QUIET-NOT: warning:
-// CHECK6-NOT: warning:
-// CHECK6-QUIET-NOT: warning:
-// CHECK7: header_c.h:1:12: warning: single-argument constructors must be marked explicit
-// CHECK7-QUIET: header_c.h:1:12: warning: single-argument constructors must be marked explicit
#include <system-header.h>
// CHECK-NOT: warning:
@@ -89,12 +39,6 @@
// CHECK3-QUIET-NOT: warning:
// CHECK4: system-header.h:1:12: warning: single-argument constructors
// CHECK4-QUIET: system-header.h:1:12: warning: single-argument constructors
-// CHECK5-NOT: warning:
-// CHECK5-QUIET-NOT: warning:
-// CHECK6-NOT: warning:
-// CHECK6-QUIET-NOT: warning:
-// CHECK7-NOT: warning:
-// CHECK7-QUIET-NOT: warning:
class A { A(int); };
// CHECK: :[[@LINE-1]]:11: warning: single-argument constructors
@@ -105,12 +49,6 @@ class A { A(int); };
// CHECK3-QUIET: :[[@LINE-6]]:11: warning: single-argument constructors
// CHECK4: :[[@LINE-7]]:11: warning: single-argument constructors
// CHECK4-QUIET: :[[@LINE-8]]:11: warning: single-argument constructors
-// CHECK5: :[[@LINE-9]]:11: warning: single-argument constructors
-// CHECK5-QUIET: :[[@LINE-10]]:11: warning: single-argument constructors
-// CHECK6: :[[@LINE-11]]:11: warning: single-argument constructors
-// CHECK6-QUIET: :[[@LINE-12]]:11: warning: single-argument constructors
-// CHECK7: :[[@LINE-13]]:11: warning: single-argument constructors
-// CHECK7-QUIET: :[[@LINE-14]]:11: warning: single-argument constructors
// CHECK-NOT: warning:
// CHECK-QUIET-NOT: warning:
@@ -120,31 +58,16 @@ class A { A(int); };
// CHECK3-QUIET-NOT: warning:
// CHECK4-NOT: warning:
// CHECK4-QUIET-NOT: warning:
-// CHECK5-NOT: warning:
-// CHECK5-QUIET-NOT: warning:
-// CHECK6-NOT: warning:
-// CHECK6-QUIET-NOT: warning:
-// CHECK7-NOT: warning:
-// CHECK7-QUIET-NOT: warning:
-// CHECK: Suppressed 6 warnings (6 in non-user code)
+// CHECK: Suppressed 3 warnings (3 in non-user code)
// CHECK: Use -header-filter=.* to display errors from all non-system headers.
// CHECK-QUIET-NOT: Suppressed
// CHECK2: Suppressed 1 warnings (1 in non-user code)
// CHECK2: Use -header-filter=.* {{.*}}
// CHECK2-QUIET-NOT: Suppressed
-// CHECK3: Suppressed 5 warnings (5 in non-user code)
+// CHECK3: Suppressed 2 warnings (2 in non-user code)
// CHECK3: Use -header-filter=.* {{.*}}
// CHECK3-QUIET-NOT: Suppressed
// CHECK4-NOT: Suppressed {{.*}} warnings
// CHECK4-NOT: Use -header-filter=.* {{.*}}
// CHECK4-QUIET-NOT: Suppressed
-// CHECK5: Suppressed 5 warnings (5 in non-user code)
-// CHECK5: Use -header-filter=.* to display errors from all non-system headers.
-// CHECK5-QUIET-NOT: Suppressed
-// CHECK6: Suppressed 5 warnings (5 in non-user code)
-// CHECK6: Use -header-filter=.* to display errors from all non-system headers.
-// CHECK6-QUIET-NOT: Suppressed
-// CHECK7: Suppressed 5 warnings (5 in non-user code)
-// CHECK7: Use -header-filter=.* to display errors from all non-system headers.
-// CHECK7-QUIET-NOT: Suppressed
More information about the cfe-commits
mailing list