[api-digester] For readFileLineByLine() ignore lines that are comments

Allows us to add informational comments in the text files that are used as inputs for the digester.
This commit is contained in:
Argyrios Kyrtzidis
2018-11-28 15:34:36 -08:00
parent c2280ab37b
commit 2358c8944f

View File

@@ -2192,8 +2192,11 @@ static int readFileLineByLine(StringRef Path, llvm::StringSet<> &Lines) {
StringRef Line;
std::tie(Line, BufferText) = BufferText.split('\n');
Line = Line.trim();
if (!Line.empty())
Lines.insert(Line);
if (Line.empty())
continue;
if (Line.startswith("// ")) // comment.
continue;
Lines.insert(Line);
}
return 0;
}