[PATCH] D87929: [lld-macho] Support -weak_lx, -weak_library, -weak_framework

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 14:04:56 PDT 2020


gkm accepted this revision.
gkm added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/MachO/Driver.cpp:612
+      auto *dylibFile = dyn_cast_or_null<DylibFile>(addFile(arg->getValue()));
+      if (dylibFile != nullptr)
+        dylibFile->forceWeakImport = true;
----------------
I always find explicit `nullptr`-inequality checks to be overly noisy. I just looked and found that there are only three instances of `!= nullptr` in all of `lld/MachO/*.{h,cpp}`, which IMO is at least two too many. The third is semi-legit for highlighting the boolean nature of pointer-to-something vs. pointer-to-nothing:
```
./UnwindInfoSection.cpp:  return (compactUnwindSection != nullptr);
```
If you don't feel so strongly about it, then please allow me to impose my will regarding this stylistic nit. If you do feel strongly, then I bet you could find a ton of places to add `!= nullptr`. We could even start an edit war! 😆


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87929



More information about the llvm-commits mailing list