From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- clang/lib/Frontend/DependencyFile.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'clang/lib/Frontend/DependencyFile.cpp') diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index 4bb0167bd597..c9240f4122a7 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/lib/Frontend/DependencyFile.cpp @@ -137,16 +137,17 @@ struct DepCollectorASTListener : public ASTReaderListener { }; } // end anonymous namespace -void DependencyCollector::maybeAddDependency(StringRef Filename, bool FromModule, - bool IsSystem, bool IsModuleFile, - bool IsMissing) { +void DependencyCollector::maybeAddDependency(StringRef Filename, + bool FromModule, bool IsSystem, + bool IsModuleFile, + bool IsMissing) { if (sawDependency(Filename, FromModule, IsSystem, IsModuleFile, IsMissing)) addDependency(Filename); } bool DependencyCollector::addDependency(StringRef Filename) { if (Seen.insert(Filename).second) { - Dependencies.push_back(Filename); + Dependencies.push_back(std::string(Filename)); return true; } return false; @@ -160,8 +161,8 @@ static bool isSpecialFilename(StringRef Filename) { } bool DependencyCollector::sawDependency(StringRef Filename, bool FromModule, - bool IsSystem, bool IsModuleFile, - bool IsMissing) { + bool IsSystem, bool IsModuleFile, + bool IsMissing) { return !isSpecialFilename(Filename) && (needSystemDependencies() || !IsSystem); } -- cgit v1.2.3