[clang-tools-extra] 5e6428b - [clangd] Use the normalized file path to do the filtering.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 2 04:36:35 PST 2023


Author: Haojian Wu
Date: 2023-03-02T13:36:24+01:00
New Revision: 5e6428b00393d0483f5fede641bbb519632e9585

URL: https://github.com/llvm/llvm-project/commit/5e6428b00393d0483f5fede641bbb519632e9585
DIFF: https://github.com/llvm/llvm-project/commit/5e6428b00393d0483f5fede641bbb519632e9585.diff

LOG: [clangd] Use the normalized file path to do the filtering.

This is an oversight, where we normalized the path, but we didn't use it
in the filtering.

Added: 
    

Modified: 
    clang-tools-extra/clangd/IncludeCleaner.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp
index d9804abd82ee7..7d523d9a63641 100644
--- a/clang-tools-extra/clangd/IncludeCleaner.cpp
+++ b/clang-tools-extra/clangd/IncludeCleaner.cpp
@@ -292,7 +292,7 @@ static bool mayConsiderUnused(const Inclusion &Inc, ParsedAST &AST,
     // Convert the path to Unix slashes and try to match against the filter.
     llvm::SmallString<64> Path(Inc.Resolved);
     llvm::sys::path::native(Path, llvm::sys::path::Style::posix);
-    if (Filter(Inc.Resolved)) {
+    if (Filter(Path)) {
       dlog("{0} header is filtered out by the configuration", FE->getName());
       return false;
     }


        


More information about the cfe-commits mailing list