This is an archive of the discontinued LLVM Phabricator instance.

[Tooling] Acknowledge that many CompilationDatabases don't support enumeration.
ClosedPublic

Authored by sammccall on Nov 24 2017, 2:16 AM.

Event Timeline

sammccall created this revision.Nov 24 2017, 2:16 AM
sammccall edited reviewers, added: hokein; removed: ioeric.Nov 24 2017, 2:17 AM
grandinj added inline comments.
include/clang/Tooling/CompilationDatabase.h
122

I know very little about LLVM's standards, so ignore me if I'm wrong, but shouldn't this be returning a pair of (begin,end) iterators rather than potentially a copy of a very large array of strings?

And shouldn't it be returning an iteration over StringRef rather then std::string, which will require copying the actual data?

133

similarly here

hokein accepted this revision.Nov 24 2017, 3:12 AM

LGTM.

This revision is now accepted and ready to land.Nov 24 2017, 3:12 AM
sammccall added inline comments.Nov 24 2017, 4:10 AM
include/clang/Tooling/CompilationDatabase.h
122

You might well be right. But this is an existing interface designed as an extension point for out-of-tree build systems. I'd rather not break them unless we have evidence of an actual performance problem.
(Note my change here is backwards compatible and doesn't change the signature)

This revision was automatically updated to reflect the committed changes.