vmiklos marked an inline comment as done.
vmiklos added a comment.

> As it stands, I feel like this check is a bit too simplistic to have much 
> value, but if you covered some of these other cases, it would alleviate that 
> worry for me.

I've now added support for detecting inverted conditions when it comes to 
`#ifdef` and `#ifndef` (see extended documentation and testcases). I'll also 
check what can I do for `#if`. I think it would not be too hard to detect just 
repeated conditions. if I have the full range, then I can look for end of the 
first line that does not end with `\`, and that would be a poor man's way to 
get the `#if` condition. Let's see if that works in practice.



================
Comment at: clang-tidy/readability/RedundantPreprocessorCheck.cpp:19-22
+struct Entry {
+  SourceLocation Loc;
+  std::string MacroName;
+};
----------------
Szelethus wrote:
> vmiklos wrote:
> > Szelethus wrote:
> > > This is a way too general name in my opinion. Either include comments 
> > > that describe it, or rename it (preferably both).
> > Renamed to `PreprocessorCondition`, hope it helps. :-)
> I actually meant it for `Entry`, if you hover your mouse over an inline 
> comment, you can see which lines it applies to. Sorry for the confusing 
> communication :D
Done now. Nah, it's more about I'm not so fluent with phabricator. :-)


https://reviews.llvm.org/D54349



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to