[PATCH] D16113: [clang-tdiy] Add header file extension configuration support.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 15 10:03:42 PST 2016
hokein marked 2 inline comments as done.
================
Comment at: clang-tidy/ClangTidyOptions.cpp:269
@@ +268,3 @@
+ SmallVector<llvm::StringRef, 5> Suffixes;
+ HeaderFileExtensions.split(Suffixes, ',');
+ for (const auto& Suffix : Suffixes) {
----------------
aaron.ballman wrote:
> alexfh wrote:
> > It's rather inefficient to split the string each time the function is called. If even we needed this function, we would better pass an `ArrayRef<StringRef>`. But even better, we can use `llvm::StringSet` and get rid of this function at all (we might need a helper function to parse a comma-separated list of extensions to a StringSet though).
> This code seems like it will fail if there are spaces in the extension list, like `.h, .hxx` instead of `.h,.hxx`. I think the list, as given by the end user, should be processed into a vector of sorts so that things can be normalized (entries without a period can be diagnosed, spaces removed, etc).
Now it's tolerant of whitespace around the commas.
http://reviews.llvm.org/D16113
More information about the cfe-commits
mailing list