[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 17:08:41 PST 2020


Charusso accepted this revision.
Charusso added a comment.
This revision is now accepted and ready to land.

Cool, thanks you!



================
Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:612
+  return !(Range.getBegin().isMacroID() || Range.getEnd().isMacroID());
+}
+
----------------
Side note: I like the other form of De Morgan's laws because here I have to apply it in my head every time I see such a construct. Also we are using this function in negation, so I would write:
```lang=c
static bool isMacro(const SourceRange &Range) {
  return Range.getBegin().isMacroID() || Range.getEnd().isMacroID();
}
```

The idiom is to write code for readability so that understandability over everything else.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993





More information about the cfe-commits mailing list