[PATCH] D39259: [lld] unified COFF and ELF error handling on new Common/ErrorHandler

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 21:06:45 PDT 2017


ruiu added inline comments.


================
Comment at: lld/include/lld/Common/ErrorHandler.h:50-81
+  ErrorHandler &setColorDiagnostics(bool Enable) {
+    ColorDiagnostics = Enable;
+    return *this;
+  }
+  ErrorHandler &setErrorLimit(uint64_t Limit) {
+    ErrorLimit = Limit;
+    return *this;
----------------
These Java-ish method chains are not very lld-ish. It is better to directly expose the members.


================
Comment at: lld/include/lld/Common/ErrorHandler.h:85-93
+  bool ColorDiagnostics;
+  uint64_t ErrorCount;
+  uint64_t ErrorLimit;
+  StringRef ErrorLimitExceededMsg;
+  llvm::raw_ostream *ErrorOS;
+  bool ExitEarly;
+  bool FatalWarnings;
----------------
You can use C++11-style member initialization because all these values are constant. E.g.

  bool ColorDiagnostics = false;



https://reviews.llvm.org/D39259





More information about the llvm-commits mailing list