[PATCH] D93712: [flang][driver] Add checks for errors from `Prescan` and `Parse`

sameeran joshi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 22:33:46 PST 2021


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

Mostly nit comments.
Thanks and LGMT.



================
Comment at: flang/lib/Frontend/FrontendAction.cpp:59
+  if (ci.parsing().messages().AnyFatalError()) {
+    unsigned diagID = ci.diagnostics().getCustomDiagID(
+        clang::DiagnosticsEngine::Error, "could not scan %0");
----------------
`nit` - would be better to use `const` as much as possible if there are not modifications to the variables.

point 13
https://github.com/llvm/llvm-project/blob/master/flang/docs/C++style.md#c-language



================
Comment at: flang/lib/Frontend/FrontendAction.cpp:60
+    unsigned diagID = ci.diagnostics().getCustomDiagID(
+        clang::DiagnosticsEngine::Error, "could not scan %0");
+    ci.diagnostics().Report(diagID) << GetCurrentFileOrBufferName();
----------------
`nit:` - Should the error messages start with a capital letter?
https://github.com/llvm/llvm-project/blob/master/flang/docs/C++style.md#error-messages


================
Comment at: flang/lib/Frontend/FrontendAction.cpp:63
+    ci.parsing().messages().Emit(
+        llvm::errs(), this->instance().allCookedSources());
+
----------------
`nit` - `ci` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93712



More information about the llvm-commits mailing list