[PATCH] D48116: [libclang] Allow skipping warnings from all included files

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 19 01:11:01 PST 2019


ilya-biryukov added a comment.

This LGTM wrt to layering, i.e. it's nice we don't need to change the code of diagnostics.
It's been a while since I've looked at the ASTUnit code, though, would be good if someone else took an extra look at it.

Added a few nits too.



================
Comment at: lib/Frontend/ASTUnit.cpp:682
+  auto &M = D.getSourceManager();
+  return M.isInMainFile(M.getExpansionLoc(D.getLocation()));
+}
----------------
`isWrittenInMainFile` might be a better fit: it does not look at presumed locations. That would be the expected behavior in the most common case, i.e. showing errors in an IDE or a text editor.


================
Comment at: lib/Frontend/ASTUnit.cpp:694
+  if ((!Info.hasSourceManager() || &Info.getSourceManager() == SourceMgr) &&
+      (StoredDiags || StandaloneDiags)) {
+    if (!CaptureNonErrorsFromIncludes
----------------
Why do we need this extra check? We checked for StoredDiags and Standalone diags in the body of the statement later again.


Repository:
  rC Clang

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

https://reviews.llvm.org/D48116





More information about the cfe-commits mailing list