diff --git a/include/llvm/Support/FileCollector.h b/include/llvm/Support/FileCollector.h index 19429bd3e9b..079fe3efab9 100644 --- a/include/llvm/Support/FileCollector.h +++ b/include/llvm/Support/FileCollector.h @@ -46,7 +46,11 @@ public: private: void addFileImpl(StringRef SrcPath); - bool markAsSeen(StringRef Path) { return Seen.insert(Path).second; } + bool markAsSeen(StringRef Path) { + if (Path.empty()) + return false; + return Seen.insert(Path).second; + } bool getRealPath(StringRef SrcPath, SmallVectorImpl &Result);