[PATCH] Add clang-tidy -line-filter option to filter findings by line ranges.
Manuel Klimek
klimek at google.com
Thu May 22 07:05:09 PDT 2014
================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:273
@@ +272,3 @@
+ unsigned LineNumber) const {
+ llvm::errs() << "passesLineFilter " << FileName << ":" << LineNumber << "\n";
+ if (Context.getOptions().LineFilter.empty())
----------------
Debug output?
================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.h:175
@@ +174,3 @@
+ std::pair<bool, bool>
+ relatesToUserCodeAndPassesLineFilter(SourceLocation Location);
+
----------------
That's a strange interface. I assume you want to remove some duplication that way? If true, I'd rather pull out the common code into a 3rd helper function and use that from both places.
================
Comment at: clang-tidy/ClangTidyOptions.h:23
@@ +22,3 @@
+ std::string Name;
+ typedef std::pair<unsigned, unsigned> LineRange;
+ std::vector<LineRange> LineRanges;
----------------
// LineRange is a pair<start, end> (inclusive).
Or something like that.
http://reviews.llvm.org/D3873
More information about the cfe-commits
mailing list