[PATCH] D47162: [WebAssembly] Initial support for LTO

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 16:48:35 PDT 2018


ruiu added inline comments.


================
Comment at: wasm/InputFiles.cpp:374
+                                   BitcodeFile &F) {
+  StringRef NameRef = Saver.save(ObjSym.getName());
+
----------------
What does `Ref` means? I'd name this just `Name`.


================
Comment at: wasm/InputFiles.cpp:392
+  if (T.getArch() != Triple::wasm32) {
+    fatal(toString(MB.getBufferIdentifier()) + ": machine type must be wasm32");
+    return;
----------------
`fatal` is to report corrupted files. Since this case is to report a miseuse of the command, you should use `error`.


================
Comment at: wasm/LTO.cpp:44
+// This is for use when debugging LTO.
+static void saveBuffer(StringRef Buffer, const Twine &Path) {
+  std::error_code EC;
----------------
Move this to Common/Strings.cpp.


================
Comment at: wasm/LTO.cpp:52
+
+static void checkError(Error E) {
+  handleAllErrors(std::move(E),
----------------
I'd think you should move this function to Common/ErrorHandler.cpp.


================
Comment at: wasm/LTO.cpp:57
+
+static void diagnosticHandler(const DiagnosticInfo &DI) {
+  SmallString<128> S;
----------------
Move this to Common/ErrorHandler.cpp.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47162





More information about the llvm-commits mailing list