diff --git a/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp b/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp index 9431211b03e71..372ab5fa2706e 100644 --- a/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp +++ b/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp @@ -312,11 +312,11 @@ std::function headerFilter() { // Maps absolute path of each files of each compilation commands to the // absolute path of the input file. -llvm::Expected> +llvm::Expected>> mapInputsToAbsPaths(clang::tooling::CompilationDatabase &CDB, llvm::IntrusiveRefCntPtr VFS, const std::vector &Inputs) { - std::map CDBToAbsPaths; + std::map> CDBToAbsPaths; // Factory.editedFiles()` will contain the final code, along with the // path given in the compilation database. That path can be // absolute or relative, and if it is relative, it is relative to the @@ -395,8 +395,7 @@ int main(int argc, const char **argv) { if (Edit) { for (const auto &NameAndContent : Factory.editedFiles()) { llvm::StringRef FileName = NameAndContent.first(); - if (auto It = CDBToAbsPaths->find(FileName.str()); - It != CDBToAbsPaths->end()) + if (auto It = CDBToAbsPaths->find(FileName); It != CDBToAbsPaths->end()) FileName = It->second; const std::string &FinalCode = NameAndContent.second;