From c1440088aea048452530b17e65e960657dd21907 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 20 Nov 2019 10:38:55 -0800 Subject: [PATCH] [FileCollector] Ignore empty paths. Don't insert empty strings into the StringSet<> because that triggers an assert in its implementation. --- include/llvm/Support/FileCollector.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);